diff options
author | Loic Dachary <loic@dachary.org> | 2013-09-27 19:09:23 +0200 |
---|---|---|
committer | Loic Dachary <loic@dachary.org> | 2013-10-02 09:17:09 +0200 |
commit | d1c1f3eb9098e74e9483609ff4f90e8de83c4016 (patch) | |
tree | 5a88bd09013e6215845ced027cbec2e5031b4517 | |
parent | 16fbdcdf9fd4fc28e67104f2cb20ff0e4043d3aa (diff) | |
download | ceph-d1c1f3eb9098e74e9483609ff4f90e8de83c4016.tar.gz |
common: document ghobject sort order rationale
Intuition differs regarding the sort order of the ghobject shard and
generation. Document the rationale for the chosen sort order.
Reviewed-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
-rw-r--r-- | src/common/hobject.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/hobject.h b/src/common/hobject.h index 46fc67b893a..82eecf3bfc7 100644 --- a/src/common/hobject.h +++ b/src/common/hobject.h @@ -288,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, |