kernel hash function algorithm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: kernel hash function algorithm
- From: Onkar Mahajan <kern.devel@xxxxxxxxx>
- Date: Fri, 9 Apr 2010 22:10:53 +0530
Why is the hash calculated like this ?
static unsigned long hash(struct super_block *sb, unsigned long hashval)
{
unsigned long tmp;
tmp = (hashval * (unsigned long)sb) ^ (GOLDEN_RATIO_PRIME + hashval) /
L1_CACHE_BYTES;
tmp = tmp ^ ((tmp ^ GOLDEN_RATIO_PRIME) >> I_HASHBITS);
return tmp & I_HASHMASK;
}
Regards,
Onkar
[Index of Archives]
[Newbies FAQ]
[Linux Kernel Mentors]
[Linux Kernel Development]
[IETF Annouce]
[Git]
[Networking]
[Security]
[Bugtraq]
[Yosemite]
[MIPS Linux]
[ARM Linux]
[Linux RAID]
[Linux SCSI]
[Linux ACPI]