Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\jhash.h Create Date:2022-07-28 06:07:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:jhash - hash an arbitrary key*@k: sequence of bytes as key*@length: the length of the key*@initval: the previous hash, or an arbitray value* The generic version, hashes an arbitrary sequence of bytes.

Proto:static inline u32 jhash(const void *key, u32 length, u32 initval)

Type:u32

Parameter:

TypeParameterName
const void *key
u32length
u32initval
73  k = key
76  a = b = c = An arbitrary initial parameter + length + initval
79  When length > 12 cycle
80  a += __get_unaligned_cpu32(k)
81  b += __get_unaligned_cpu32(k + 4)
82  c += __get_unaligned_cpu32(k + 8)
84  length -= 12
85  k += 12
89  Case length == 12
89  c += k[11] << 24
90  Case length == 11
90  c += k[10] << 16
91  Case length == 10
91  c += k[9] << 8
92  Case length == 9
92  c += k[8]
93  Case length == 8
93  b += k[7] << 24
94  Case length == 7
94  b += k[6] << 16
95  Case length == 6
95  b += k[5] << 8
96  Case length == 5
96  b += k[4]
97  Case length == 4
97  a += k[3] << 24
98  Case length == 3
98  a += k[2] << 16
99  Case length == 2
99  a += k[1] << 8
100  Case length == 1
100  a += k[0]
102  Case length == 0
103  Break
106  Return c
Caller
NameDescribe
wqattrs_hashhash value of the content of @attr
__tracing_map_insert
htab_map_hash
strhash