Skip to content

Commit ac6e612

Browse files
authored
Merge pull request ceph#62084 from xxhdx1985126/wip-70202
crimson/os/seastore/linked_tree_node: set reserved_ptr to an 8-byte aligned address Reviewed-by: Yingxin Cheng <[email protected]> Reviewed-by: Matan Breizman <[email protected]>
2 parents bf9bdd3 + 3303f86 commit ac6e612

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/crimson/os/seastore/linked_tree_node.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ class BaseChildNode {
217217
// indirect mapping.
218218
template <typename T, typename node_key_t>
219219
inline BaseChildNode<T, node_key_t>* get_reserved_ptr() {
220-
return (BaseChildNode<T, node_key_t>*)0x1;
220+
//TODO: using instant integers as invalid pointers may
221+
// not be a good practice.
222+
constexpr uint64_t reserved_ptr = std::numeric_limits<size_t>::max() - 15;
223+
return (BaseChildNode<T, node_key_t>*)reserved_ptr;
221224
}
222225

223226
template <typename T, typename node_key_t>

0 commit comments

Comments
 (0)