Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bucket_table_alloc

Proto:static struct bucket_table *bucket_table_alloc(struct rhashtable *ht, size_t nbuckets, gfp_t gfp)

Type:struct bucket_table

Parameter:

TypeParameterName
struct rhashtable *ht
size_tnbuckets
gfp_tgfp
170  struct bucket_table * tbl = NULL
175  tbl = kvzalloc(struct_size() - Calculate size of structure with trailing array.*@p: Pointer to the structure.*@member: Name of the array member.*@n: Number of elements in the array.* Calculates size of memory needed for structure @p followed by an(tbl, buckets, nbuckets), gfp)
177  size = nbuckets
179  If tbl == NULL && (gfp & ~__GFP_NOFAIL) != GFP_KERNEL Then
180  tbl = nested_bucket_table_alloc(ht, nbuckets, gfp)
181  nbuckets = 0
184  If (tbl == NULL) Then Return NULL
187  lockdep_init_map( & dep_map, "rhashtable_bucket", & __key, 0)
189  size = size
191  _head_init - Initialize rcu_head for rcu_head_after_call_rcu()*@rhp: The rcu_head structure to initialize
192  Initialization list head
194  hash_rnd = get_random_u32()
196  When i < nbuckets cycle INIT_RHT_NULLS_HEAD(buckets[i])
199  Return tbl
Caller
NameDescribe
rhashtable_rehash_alloc
rhashtable_insert_rehash
rhashtable_inithashtable_init - initialize a new hash table*@ht: hash table to be initialized*@params: configuration parameters* Initializes a new hash table based on the provided configuration* parameters