函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sg_calculate_split

函数原型:static int sg_calculate_split(struct scatterlist *in, int nents, int nb_splits, off_t skip, const size_t *sizes, struct sg_splitter *splitters, bool mapped)

返回类型:int

参数:

类型参数名称
struct scatterlist *in
intnents
intnb_splits
off_tskip
const size_t *sizes
struct sg_splitter *splitters
boolmapped
26  size等于sizes[0]
27  curr等于splitters
30 i小于nb_splits循环
31  in_sg0 = NULL
32  nents等于0
36  sglen等于如果mappedsg_dma_len(sg)否则length
37  如果skip大于sglen
38  skip减等于sglen
39  继续下一循环
42  len等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, size, sglen - skip)
43  如果非in_sg0
44  in_sg0等于sg
45  skip_sg0等于skip
47  size减等于len
48  nents自加
49  length_last_sg等于len
51  当非sizeskiplen小于sglennb_splits先自减大于0循环
52  curr自加
53  size等于*sizes先自加
54  skip加等于len
57  in_sg0等于sg
58  skip_sg0等于skip
59  nents等于1
60  length_last_sg等于len
61  size减等于len
63  skip等于0
65  如果非sizenb_splits先自减大于0则
66  curr自加
67  size等于*sizes先自加
70  如果非nb_splits退出
74  返回:如果size或非in_sg0则负EINVAL否则0
调用者
名称描述
sg_splitsg_split - split a scatterlist into several scatterlists*@in: the input sg list*@in_mapped_nents: the result of a dma_map_sg(in,