函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__sg_alloc_table - Allocate and initialize an sg table with given allocator*@table: The sg table header to use*@nents: Number of entries in sg list*@max_ents: The maximum number of entries the allocator returns per call*@nents_first_chunk: Number of

函数原型:int __sg_alloc_table(struct sg_table *table, unsigned int nents, unsigned int max_ents, struct scatterlist *first_chunk, unsigned int nents_first_chunk, gfp_t gfp_mask, sg_alloc_fn *alloc_fn)

返回类型:int

参数:

类型参数名称
struct sg_table *table
unsigned intnents
unsigned intmax_ents
struct scatterlist *first_chunk
unsigned intnents_first_chunk
gfp_tgfp_mask
sg_alloc_fn *alloc_fn
273  curr_max_ents等于如果nents_first_chunk否则max_ents
276  memset(table, 0, table的长度)
278  如果nents恒等于0则返回:负EINVAL
285  left等于nents
286  prv = NULL
287  循环
288  alloc_size等于left
290  如果alloc_size大于curr_max_ents
292  sg_size等于alloc_size减1
293  否则sg_size等于alloc_size
296  left减等于sg_size
298  如果first_chunk
299  sg等于first_chunk
300  first_chunk = NULL
301  否则
314  返回:负ENOMEM
317  初始化散列表
318  number of mapped entries 等于 original size of list 加等于sg_size
324  如果prv链接两个散列表
326  否则 the list 等于sg
332  如果非left标记散列表结束
335  prv等于sg
336  prv_max_ents等于curr_max_ents
337  curr_max_ents等于max_ents
338 left循环
340  返回:0
调用者
名称描述
sg_alloc_tablesg_alloc_table - Allocate and initialize an sg table*@table: The sg table header to use*@nents: Number of entries in sg list*@gfp_mask: GFP allocation mask* Description:* Allocate and initialize an sg table. If @nents@ is larger than
sg_alloc_table_chainedsg_alloc_table_chained - Allocate and chain SGLs in an sg table*@table: The sg table header to use*@nents: Number of entries in sg list*@first_chunk: first SGL*@nents_first_chunk: number of the SGL of @first_chunk* Description: