函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__sg_alloc_table_from_pages - Allocate and initialize an sg table from* an array of pages*@sgt: The sg table header to use*@pages: Pointer to an array of page pointers*@n_pages: Number of pages in the pages array*@offset: Offset from start of the first

函数原型:int __sg_alloc_table_from_pages(struct sg_table *sgt, struct page **pages, unsigned int n_pages, unsigned int offset, unsigned long size, unsigned int max_segment, gfp_t gfp_mask)

返回类型:int

参数:

类型参数名称
struct sg_table *sgt
struct page **pages
unsigned intn_pages
unsigned intoffset
unsigned longsize
unsigned intmax_segment
gfp_tgfp_mask
398  如果WARN_ON(!max_segment || offset_in_page(max_segment))则返回:负EINVAL
402  chunks等于1
403  seg_len等于0
404 i小于n_pages循环
405  seg_len加等于PAGE_SIZE
406  如果seg_len大于等于max_segmentpage_to_pfn(pages[i])不等于page_to_pfn(pages[i - 1])加1则
408  chunks自加
409  seg_len等于0
413  ret等于sg_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
414  如果此条件成立可能性小(为编译器优化)(ret)则返回:ret
418  cur_page等于0
423  seg_len等于0
424 j小于n_pages循环
425  seg_len加等于PAGE_SIZE
426  如果seg_len大于等于max_segmentpage_to_pfn(pages[j])不等于page_to_pfn(pages[j - 1])加1则退出
432  chunk_size等于jcur_page左移PAGE_SHIFT determines the page size 位的值减offset
433  sg_set_page - Set sg entry to point at given page*@sg: SG entry*@page: The page*@len: Length of data*@offset: Offset into page* Description:* Use this function to set an sg entry pointing at a page, never assign* the page directly
435  size减等于chunk_size
436  offset等于0
437  cur_page等于j
440  返回:0
调用者
名称描述
sg_alloc_table_from_pagessg_alloc_table_from_pages - Allocate and initialize an sg table from* an array of pages*@sgt: The sg table header to use*@pages: Pointer to an array of page pointers*@n_pages: Number of pages in the pages array*@offset: Offset from start of the first page