From: Yingxin Cheng Date: Wed, 22 Sep 2021 07:43:23 +0000 (+0800) Subject: crimson/onode-staged-tree: consolidate laddr hint calculation X-Git-Tag: v17.1.0~828^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43254%2Fhead;p=ceph.git crimson/onode-staged-tree: consolidate laddr hint calculation Signed-off-by: Yingxin Cheng --- 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 82dec5c06348..be138ae84e31 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 @@ -42,14 +42,13 @@ template<> struct _full_key_type { using type = key_hobj_t; }; template using full_key_t = typename _full_key_type::type; -static laddr_t get_lba_hint(shard_t shard, pool_t pool, crush_hash_t crush) -{ - if (shard == shard_id_t::NO_SHARD) { - return (uint64_t)(pool & 0xFF)<<56 | (uint64_t)(crush)<<24; - } else { - return (uint64_t)(shard & 0X7F)<<56 | (uint64_t)(pool& 0xFF)<<48 | - (uint64_t)(crush)<<16; - } +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 ((uint64_t)(shard & 0XFF)<<56 | + (uint64_t)(pool & 0xFF)<<48 | + (uint64_t)(crush )<<16); } struct node_offset_packed_t {