函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:vec_split_segs - verify whether or not a bvec should be split in the middle*@q: [in] request queue associated with the bio associated with @bv*@bv: [in] bvec to examine*@nsegs: [in,out] Number of segments in the bio being built

函数原型:static bool bvec_split_segs(const struct request_queue *q, const struct bio_vec *bv, unsigned *nsegs, unsigned *sectors, unsigned max_segs, unsigned max_sectors)

返回类型:bool

参数:

类型参数名称
const struct request_queue *q
const struct bio_vec *bv
unsigned *nsegs
unsigned *sectors
unsignedmax_segs
unsignedmax_sectors
201  max_len等于两数取小(max_sectors, UINT_MAX >> 9)减sectors左移9位
202  len等于两数取小(bv_len, max_len)
203  total_len等于0
204  seg_size等于0
206 lennsegs小于max_segs循环
207  seg_size等于get_max_segment_size(q, bv_page, bv_offset + total_len)
209  seg_size等于两数取小(seg_size, len)
211  nsegs自加
212  total_len加等于seg_size
213  len减等于seg_size
215  如果bv_offsettotal_len按位与queue_virt_boundary(q)则退出
219  sectors加等于total_len右移9位
222  返回:len大于0或bv_len大于max_len
调用者
名称描述
blk_bio_segment_splitlk_bio_segment_split - split a bio in two bios*@q: [in] request queue pointer*@bio: [in] bio to be split*@bs: [in] bio set to allocate the clone from*@segs: [out] number of segments in the bio with the first half of the sectors* Clone @bio, update the
blk_recalc_rq_segments