Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__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

Proto: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)

Type:int

Parameter:

TypeParameterName
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 = If nents_first_chunk Else max_ents
276  memset(table, 0, size of table )
278  If nents == 0 Then Return -EINVAL
285  left = nents
286  prv = NULL
287  Do
288  alloc_size = left
290  If alloc_size > curr_max_ents Then
292  sg_size = alloc_size - 1
293  Else sg_size = alloc_size
296  left -= sg_size
298  If first_chunk Then
299  sg = first_chunk
300  first_chunk = NULL
301  Else
314  Return -ENOMEM
317  sg_init_table - Initialize SG table*@sgl: The SG table*@nents: Number of entries in table* Notes:* If this is part of a chained sg table, sg_mark_end() should be* used only on the last table part.
318  number of mapped entries = original size of list += sg_size
324  If prv Then sg_chain - Chain two sglists together*@prv: First scatterlist*@prv_nents: Number of entries in prv*@sgl: Second scatterlist* Description:* Links @prv@ and @sgl@ together, to form a longer scatterlist.
326  Else the list = sg
332  If Not left Then sg_mark_end - Mark the end of the scatterlist*@sg: SG entryScatterlist* Description:* Marks the passed in sg entry as the termination point for the sg* table. A call to sg_next() on this entry will return NULL.
335  prv = sg
336  prv_max_ents = curr_max_ents
337  curr_max_ents = max_ents
338  When left cycle
340  Return 0
Caller
NameDescribe
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: