函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__blkdev_issue_write_same - generate number of bios with same page*@bdev: target blockdev*@sector: start sector*@nr_sects: number of sectors to write*@gfp_mask: memory allocation flags (for bio_alloc)*@page: page containing data to write*@biop: pointer to

函数原型:static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, struct page *page, struct bio **biop)

返回类型:int

参数:

类型参数名称
struct block_device *bdev
sector_tsector
sector_tnr_sects
gfp_tgfp_mask
struct page *page
struct bio **biop
135  q等于bdev_get_queue(bdev)
137  bio等于biop
140  如果非q则返回:负ENXIO
143  如果bdev_read_only(bdev)则返回:负EPERM
146  bs_mask等于bdev_logical_block_size(bdev)右移9位的值减1
147  如果sector按位或nr_sects的值按位与bs_mask则返回:负EINVAL
150  如果非bdev_write_same(bdev)则返回:负EOPNOTSUPP
154  max_write_same_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.
156 nr_sects循环
157  bio等于blk_next_bio(bio, 1, gfp_mask)
158  device address in 512 byte sectors 等于sector
159  bio_set_dev(bio, bdev)
160  how many bio_vec's 等于1
161  bv_page等于page
162  bv_offset等于0
163  bv_len等于bdev_logical_block_size(bdev)
164  bsolete, don't use in new code
166  如果nr_sects大于max_write_same_sectors
170  否则
171  residual I/O count 等于nr_sects左移9位
172  nr_sects等于0
174  cond_resched()
177  biop等于bio
178  返回:0
调用者
名称描述
blkdev_issue_write_samelkdev_issue_write_same - queue a write same operation*@bdev: target blockdev*@sector: start sector*@nr_sects: number of sectors to write*@gfp_mask: memory allocation flags (for bio_alloc)*@page: page containing data* Description: