Hash functions how they work in kernel?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,
 I am studying hash functions in route.c kernel file
rt_hash_rnd = (int) ((num_physpages ^ (num_physpages>>8)) ^ (jiffies ^
(jiffies >> 7)));
 where rt_hash_rnd is unsigned long 

rt_hash_rnd is used in 
static unsigned int rt_hash_code(u32 daddr, u32 saddr, u8 tos)
{
	return (jhash_3words(daddr, saddr, (u32) tos, rt_hash_rnd)
		& rt_hash_mask);
}

 And what get_random_bytes does in route.c file?
get_random_bytes(&rt_hash_rnd, 4);
then how can 
        I am newbie in kernel analysis please help to know uses of
hash functions in kernel.
regards,
rahul.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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]
  Powered by Linux