X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fobdclass%2Fhash.c;h=5ad1e91a860a20e41c1a0d939cbf9b054f2e3e60;hb=ec57f72913a3f9fb1464d8430ffb2e907098fbcc;hp=26e9e9ed9f6c5908285992e9fee6362dabd375ee;hpb=c3e10ade1eec36d7ed4068922f2b915dae124aac;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/hash.c b/lustre/obdclass/hash.c index 26e9e9e..5ad1e91 100644 --- a/lustre/obdclass/hash.c +++ b/lustre/obdclass/hash.c @@ -14,17 +14,22 @@ */ #include -#include #include #ifdef HAVE_SERVER_SUPPORT -# include + +#ifdef HAVE_EXT4_LDISKFS +#include +#include +#else +#include +#include +#endif + #else # include #endif #define DELTA 0x9E3779B9 -#define DX_HASH_R5 98 -#define DX_HASH_SAME 99 static void TEA_transform(__u32 buf[4], __u32 const in[]) @@ -126,23 +131,6 @@ static __u32 dx_hack_hash (const char *name, int len) return (hash0 << 1); } -static __u32 dx_r5_hash(const signed char *msg, int len) -{ - __u32 a = 0; - while (len--) { - a += *msg << 4; - a += *msg >> 4; - a *= 11; - msg++; - } - return a; -} - -static __u32 dx_same_hash(const signed char *msg, int len) -{ - return 0xcafebabeUL; -} - static void str2hashbuf(const char *msg, int len, __u32 *buf, int num) { __u32 pad, val; @@ -233,12 +221,6 @@ int ldiskfsfs_dirhash(const char *name, int len, struct ldiskfs_dx_hash_info *hi hash = buf[0]; minor_hash = buf[1]; break; - case LDISKFS_DX_HASH_R5: - hash = dx_r5_hash(name, len); - break; - case LDISKFS_DX_HASH_SAME: - hash = dx_same_hash(name, len); - break; default: hinfo->hash = 0; return -1;