summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Dachary <loic@dachary.org>2013-10-02 00:24:32 -0700
committerLoic Dachary <loic@dachary.org>2013-10-02 00:24:32 -0700
commite69baee07d03fa1c744d26975338321a70581328 (patch)
tree2d34c990b5429e97815b43d790a006fa8a3e4819
parentd2cb2bf6bac83ac6db9df6cb876317d30e7493cc (diff)
parentd1c1f3eb9098e74e9483609ff4f90e8de83c4016 (diff)
downloadceph-e69baee07d03fa1c744d26975338321a70581328.tar.gz
Merge pull request #652 from dachary/wip-ghobjects
common: ghobject sort order & get_filestore_key
-rw-r--r--src/common/hobject.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/hobject.h b/src/common/hobject.h
index e483b664347..82eecf3bfc7 100644
--- a/src/common/hobject.h
+++ b/src/common/hobject.h
@@ -241,14 +241,10 @@ public:
return ret;
}
filestore_hobject_key_t get_filestore_key_u32() const {
- assert(!hobj.max);
- return hobj._reverse_nibbles(hobj.hash);
+ return hobj.get_filestore_key_u32();
}
filestore_hobject_key_t get_filestore_key() const {
- if (hobj.max)
- return 0x100000000ull;
- else
- return get_filestore_key_u32();
+ return hobj.get_filestore_key();
}
// maximum sorted value.
@@ -292,8 +288,12 @@ namespace __gnu_cxx {
ostream& operator<<(ostream& out, const ghobject_t& o);
-WRITE_EQ_OPERATORS_3(ghobject_t, hobj, generation, shard_id)
-// sort ghobject_t's by <hobj, generation, shard_id>
+WRITE_EQ_OPERATORS_3(ghobject_t, hobj, shard_id, generation)
+// sort ghobject_t's by <hobj, shard_id, generation>
+//
+// Two objects which differ by generation are more related than
+// two objects of the same generation which differ by shard.
+//
WRITE_CMP_OPERATORS_3(ghobject_t,
hobj,
shard_id,