summaryrefslogtreecommitdiff
path: root/src/common/hobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/hobject.h')
-rw-r--r--src/common/hobject.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/common/hobject.h b/src/common/hobject.h
index e483b664347..a769ad060d9 100644
--- a/src/common/hobject.h
+++ b/src/common/hobject.h
@@ -241,14 +241,14 @@ 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();
+ }
+
+ bool is_degenerate() const {
+ return generation == NO_GEN && shard_id == NO_SHARD;
}
// maximum sorted value.
@@ -292,8 +292,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,