Message ID | 1353657999-14182-1-git-send-email-zheng.z.yan@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 22e754e..dcd23f3 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -709,12 +709,17 @@ inline ostream& operator<<(ostream& out, const dentry_key_t &k) inline bool operator<(const dentry_key_t& k1, const dentry_key_t& k2) { - /* - * order by name, then snap - */ - int c = strcmp(k1.name, k2.name); - return - c < 0 || (c == 0 && k1.snapid < k2.snapid); + bufferlist bl; + k1.encode(bl); + k2.encode(bl); + + string str1; + string str2; + bufferlist::iterator ip = bl.begin(); + ::decode(str1, ip); + ::decode(str2, ip); + + return str1 < str2; }