[sheepdog] [PATCH 2/4] sheep: compare oid directly

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Oct 20 09:07:12 CEST 2014


Comparing hash values of oids for purposes like sorting and searching
is completely unreasonable. This patch lets obj_cmp() compare oids
directly.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/recovery.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 0a8f5eb..c497ae2 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -89,10 +89,7 @@ static size_t list_buffer_size = DEFAULT_LIST_BUFFER_SIZE;
 
 static int obj_cmp(const uint64_t *oid1, const uint64_t *oid2)
 {
-	const uint64_t hval1 = sd_hash_oid(*oid1);
-	const uint64_t hval2 = sd_hash_oid(*oid2);
-
-	return intcmp(hval1, hval2);
+	return intcmp(*oid1, *oid2);
 }
 
 static inline bool node_is_gateway_only(void)
-- 
1.8.3.2




More information about the sheepdog mailing list