函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blk_bio_discard_split

函数原型:static struct bio *blk_bio_discard_split(struct request_queue *q, struct bio *bio, struct bio_set *bs, unsigned *nsegs)

返回类型:struct bio

参数:

类型参数名称
struct request_queue *q
struct bio *bio
struct bio_set *bs
unsigned *nsegs
71  nsegs等于1
74  granularity等于两数取大(discard_granularity >> 9, 1U)
76  max_discard_sectors等于两数取小(max_discard_sectors, The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size* is defined as 'unsigned int', meantime it has to aligned to with logical* block size which is the minimum accepted unit by hardware.)
78  max_discard_sectors减等于max_discard_sectors取模granularity
80  如果此条件成立可能性小(为编译器优化)(!max_discard_sectors)则
82  返回:NULL
85  如果bio_sectors(bio)小于等于max_discard_sectors则返回:NULL
88  split_sectors等于max_discard_sectors
94  alignment等于discard_alignment右移9位的值取模granularity
96  tmp等于 device address in 512 byte sectors split_sectorsalignment
97  tmp等于sector_div(tmp, granularity)
99  如果split_sectors大于tmpsplit_sectors减等于tmp
102  返回:_split - split a bio*@bio: bio to split*@sectors: number of sectors to split from the front of @bio*@gfp: gfp mask*@bs: bio set to allocate from* Allocates and returns a new bio which represents @sectors from the start of
调用者
名称描述
__blk_queue_split__blk_queue_split - split a bio and submit the second half*@q: [in] request queue pointer*@bio: [in, out] bio to be split*@nr_segs: [out] number of segments in the first bio* Split a bio into two bios, chain the two bios, submit the second half and