summaryrefslogtreecommitdiffstats
path: root/src/crimson/os
diff options
context:
space:
mode:
authorZhang Song <zhangsong02@qianxin.com>2024-08-22 14:54:03 +0200
committerZhang Song <zhangsong02@qianxin.com>2024-08-23 13:19:38 +0200
commitb2d604e581d993ac1fa9b02a8abe33fe4336853d (patch)
treeca303f582fcdd9f702adc415cf9b787fae68471c /src/crimson/os
parentcrimson/os/seastore: remove laddr_t alignment check (diff)
downloadceph-b2d604e581d993ac1fa9b02a8abe33fe4336853d.tar.xz
ceph-b2d604e581d993ac1fa9b02a8abe33fe4336853d.zip
crimson/os/seastore: construct laddr_t explicitly
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
Diffstat (limited to 'src/crimson/os')
-rw-r--r--src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h3
-rw-r--r--src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h
index ab5971dfe5f..df2e5fe7503 100644
--- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h
+++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h
@@ -150,7 +150,8 @@ class DummyNodeExtentManager final: public NodeExtentManager {
Transaction& t, extent_len_t len) {
assert(len % ALIGNMENT == 0);
auto r = ceph::buffer::create_aligned(len, ALIGNMENT);
- auto addr = laddr_t(reinterpret_cast<laddr_t::Unsigned>(r->get_data()));
+ auto addr = laddr_t::from_byte_offset(
+ reinterpret_cast<laddr_t::Unsigned>(r->get_data()));
auto bp = ceph::bufferptr(std::move(r));
auto extent = Ref<DummyNodeExtent>(new DummyNodeExtent(std::move(bp)));
extent->set_laddr(addr);
diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h
index 18ebb039f89..b40f7a061a8 100644
--- a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h
+++ b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h
@@ -46,9 +46,9 @@ static laddr_t get_lba_hint(shard_t shard, pool_t pool, crush_hash_t crush) {
// FIXME: It is possible that PGs from different pools share the same prefix
// if the mask 0xFF is not long enough, result in unexpected transaction
// conflicts.
- return laddr_t((uint64_t)(shard & 0xFF)<<56 |
- (uint64_t)(pool & 0xFF)<<48 |
- (uint64_t)(crush )<<16);
+ return laddr_t::from_raw_uint((uint64_t)(shard & 0xFF)<<56 |
+ (uint64_t)(pool & 0xFF)<<48 |
+ (uint64_t)(crush )<<16);
}
struct node_offset_packed_t {