函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\rhashtable.c Create Date:2022-07-27 07:22:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:bucket_table_alloc

函数原型:static struct bucket_table *bucket_table_alloc(struct rhashtable *ht, size_t nbuckets, gfp_t gfp)

返回类型:struct bucket_table

参数:

类型参数名称
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  如果tbl恒等于NULLgfp按位与__GFP_NOFAIL的反的值不等于GFP_KERNEL
180  tbl等于nested_bucket_table_alloc(ht, nbuckets, gfp)
181  nbuckets等于0
184  如果(tbl == NULL)则返回: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  初始化链表头
194  hash_rnd等于get_random_u32()
196 i小于nbuckets循环INIT_RHT_NULLS_HEAD(buckets[i])
199  返回:tbl
调用者
名称描述
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