When looking for some extra data to include in the hash, use the
address of the dirhash, rather than the first sizeof(struct dirhash *) bytes of the structure (which, thankfully, seem to be constant). Submitted by: Ted Unangst <tedu@zeitbombe.org> MFC after: 2 weeks
This commit is contained in:
parent
8fb0d51534
commit
da126abaf1
@ -883,7 +883,7 @@ ufsdirhash_hash(struct dirhash *dh, char *name, int namelen)
|
||||
* another in the table, which is bad for linear probing.
|
||||
*/
|
||||
hash = fnv_32_buf(name, namelen, FNV1_32_INIT);
|
||||
hash = fnv_32_buf(dh, sizeof(dh), hash);
|
||||
hash = fnv_32_buf(&dh, sizeof(dh), hash);
|
||||
return (hash % dh->dh_hlen);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user