]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/GenericObjectMap: use bitwise hash, not nibblewise
authorSage Weil <sage@redhat.com>
Tue, 18 Aug 2015 19:16:45 +0000 (15:16 -0400)
committerSage Weil <sage@redhat.com>
Wed, 19 Aug 2015 21:03:58 +0000 (17:03 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/GenericObjectMap.cc

index c289ae210421dfe4468b77bc240c0ad9d4afd1cf..7df0fb05c76639db25ccff6196a83245e2755075 100644 (file)
@@ -133,7 +133,7 @@ string GenericObjectMap::header_key(const coll_t &cid, const ghobject_t &oid)
 
   t = buf;
   snprintf(t, end - t, "%.*X", (int)(sizeof(oid.hobj.get_hash())*2),
-           (uint32_t)oid.get_nibblewise_key_u32());
+           oid.hobj.get_bitreverse_key_u32());
   full_name += string(buf);
   full_name.append(GHOBJECT_KEY_SEP_S);
 
@@ -262,10 +262,10 @@ bool GenericObjectMap::parse_header_key(const string &long_name,
   }
 
   if (out) {
-    (*out) = ghobject_t(hobject_t(name, key, snap, hash, (int64_t)pool, ns),
+    (*out) = ghobject_t(hobject_t(name, key, snap,
+                                 hobject_t::_reverse_bits(hash),
+                                 (int64_t)pool, ns),
                         generation, shard_id);
-    // restore reversed hash. see calculate_key
-    out->hobj.set_hash(out->get_nibblewise_key());
   }
 
   if (out_coll) {