]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/onode-staged-tree: consolidate laddr hint calculation 43254/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 22 Sep 2021 07:43:23 +0000 (15:43 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 22 Sep 2021 07:55:09 +0000 (15:55 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h

index 82dec5c0634881bf9796295910b201d6bdd0f65e..be138ae84e31cdb006d74b2a7988221391700065 100644 (file)
@@ -42,14 +42,13 @@ template<> struct _full_key_type<KeyT::HOBJ> { using type = key_hobj_t; };
 template <KeyT type>
 using full_key_t = typename _full_key_type<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 {