From 725db5ec8a7fd7a6b6b8870491aaeead2220beef Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 19 Nov 2008 21:34:00 -0800 Subject: [PATCH] osd: fix osd_reqid_t hash blobhash is only safe on packed types. --- src/osd/osd_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 5be3380e55ed0..6f20633b6c6b4 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -66,8 +66,8 @@ inline bool operator>=(const osd_reqid_t& l, const osd_reqid_t& r) { return !(l namespace __gnu_cxx { template<> struct hash { size_t operator()(const osd_reqid_t &r) const { - static blobhash H; - return H((const char*)&r, sizeof(r)); + static hash<__u64> H; + return H(r.name.num() ^ r.tid ^ r.inc); } }; } -- 2.39.5