函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sg_split - split a scatterlist into several scatterlists*@in: the input sg list*@in_mapped_nents: the result of a dma_map_sg(in,

函数原型:int sg_split(struct scatterlist *in, const int in_mapped_nents, const off_t skip, const int nb_splits, const size_t *split_sizes, struct scatterlist **out, int *out_mapped_nents, gfp_t gfp_mask)

返回类型:int

参数:

类型参数名称
struct scatterlist *in
const intin_mapped_nents
const off_tskip
const intnb_splits
const size_t *split_sizes
struct scatterlist **out
int *out_mapped_nents
gfp_tgfp_mask
157  splitters等于分配数组内存并置零
158  如果非splitters则返回:负ENOMEM
161  ret等于sg_calculate_split(in, 返回在散列表条目总数, nb_splits, skip, split_sizes, splitters, false)
163  如果ret小于0则转到:err
166  ret等于负ENOMEM
167 i小于nb_splits循环
168  out_sg等于分配数组内存
171  如果非out_sg则转到:err
178  sg_split_phys(splitters, nb_splits)
179  如果in_mapped_nents
180  ret等于sg_calculate_split(in, in_mapped_nents, nb_splits, skip, split_sizes, splitters, true)
182  如果ret小于0则转到:err
184  sg_split_mapped(splitters, nb_splits)
187 i小于nb_splits循环
188  out[i]等于out_sg
189  如果out_mapped_nentsout_mapped_nents[i]等于nents
193  kfree(splitters)
194  返回:0
196  err :
197 i小于nb_splits循环kfree(out_sg)
199  kfree(splitters)
200  返回:ret