17 #define DELTA 0x9E3779B9
22 __u32 b0 = buf[0], b1 = buf[1];
23 __u32 a = in[0],
b = in[1],
c = in[2],
d = in[3];
28 b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
29 b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
38 static __u32 dx_hack_hash_unsigned(
const char *
name,
int len)
40 __u32 hash, hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
41 const unsigned char *ucp = (
const unsigned char *) name;
44 hash = hash1 + (hash0 ^ (((
int) *ucp++) * 7152373));
46 if (hash & 0x80000000)
54 static __u32 dx_hack_hash_signed(
const char *
name,
int len)
56 __u32 hash, hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
57 const signed char *
scp = (
const signed char *) name;
60 hash = hash1 + (hash0 ^ (((
int) *scp++) * 7152373));
62 if (hash & 0x80000000)
70 static void str2hashbuf_signed(
const char *
msg,
int len,
__u32 *
buf,
int num)
74 const signed char *
scp = (
const signed char *) msg;
82 for (i = 0; i < len; i++) {
85 val = ((
int) scp[i]) + (val << 8);
98 static void str2hashbuf_unsigned(
const char *msg,
int len,
__u32 *buf,
int num)
102 const unsigned char *ucp = (
const unsigned char *) msg;
110 for (i = 0; i < len; i++) {
113 val = ((
int) ucp[i]) + (val << 8);
142 __u32 minor_hash = 0;
157 for (i = 0; i < 4; i++) {
167 hash = dx_hack_hash_unsigned(name, len);
170 hash = dx_hack_hash_signed(name, len);
173 str2hashbuf = str2hashbuf_unsigned;
177 (*str2hashbuf)(
p, len,
in, 8);
186 str2hashbuf = str2hashbuf_unsigned;
190 (*str2hashbuf)(
p, len,
in, 4);
191 TEA_transform(buf, in);
203 if (hash == (EXT4_HTREE_EOF_32BIT << 1))
204 hash = (EXT4_HTREE_EOF_32BIT - 1) << 1;