函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mempool_init_node

函数原型:int mempool_init_node(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data, gfp_t gfp_mask, int node_id)

返回类型:int

参数:

类型参数名称
mempool_t *pool
intmin_nr
mempool_alloc_t *alloc_fn
mempool_free_t *free_fn
void *pool_data
gfp_tgfp_mask
intnode_id
184  spin_lock_init( & lock)
185  nr of elements at *elements 等于min_nr
186  pool_data等于pool_data
187  alloc等于alloc_fn
188  free等于free_fn
189  init_waitqueue_head( & wait)
191  elements等于kmalloc_array_node(min_nr, *的长度, gfp_mask, node_id)
193  如果非elements则返回:负ENOMEM
199  Current nr of elements at *elements 小于 nr of elements at *elements 循环
202  element等于alloc(gfp_mask, pool_data)
205  返回:负ENOMEM
207  add_element(pool, element)
210  返回:0
调用者
名称描述
mempool_initmempool_init - initialize a memory pool*@pool: pointer to the memory pool that should be initialized*@min_nr: the minimum number of elements guaranteed to be* allocated for this pool.*@alloc_fn: user-defined element-allocation function.
mempool_create_node