函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:lkdev_zone_mgmt - Execute a zone management operation on a range of zones*@bdev: Target block device*@op: Operation to be performed on the zones*@sector: Start sector of the first zone to operate on*@nr_sectors: Number of sectors, should be at least the

函数原型:int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, sector_t sector, sector_t nr_sectors, gfp_t gfp_mask)

返回类型:int

参数:

类型参数名称
struct block_device *bdev
enum req_opfop
sector_tsector
sector_tnr_sectors
gfp_tgfp_mask
160  q等于bdev_get_queue(bdev)
161  zone_sectors等于blk_queue_zone_sectors(q)
162  capacity等于get_capacity(bd_disk)
163  end_sector等于sectornr_sectors
164  struct bio * bio = NULL
167  如果非blk_queue_is_zoned(q)则返回:负EOPNOTSUPP
170  如果bdev_read_only(bdev)则返回:负EPERM
173  如果非Check if a bio or request operation is a zone management operation, with* the exception of REQ_OP_ZONE_RESET_ALL which is treated as a special case* due to its different handling in the block layer and device response in* case of command failure.则返回:负EOPNOTSUPP
176  如果非nr_sectorsend_sector大于capacity则返回:负EINVAL
181  如果sector按位与zone_sectors减1则返回:负EINVAL
184  如果nr_sectors按位与zone_sectors减1且end_sector不等于capacity则返回:负EINVAL
187 sector小于end_sector循环
188  bio等于blk_next_bio(bio, 0, gfp_mask)
189  bio_set_dev(bio, bdev)
198  退出
201  bottom bits req flags, * top bits REQ_OP. Use * accessors.等于op
202  device address in 512 byte sectors 等于sector
203  sector加等于zone_sectors
206  cond_resched()
209  ret等于submit_bio_wait - submit a bio, and wait until it completes*@bio: The &struct bio which describes the I/O* Simple wrapper around submit_bio()
210  _put - release a reference to a bio*@bio: bio to release reference to* Description:* Put a reference to a &struct bio, either one you have gotten with* bio_alloc, bio_get or bio_clone_*. The last put of a bio will free it.
212  返回:ret
调用者
名称描述
blkdev_zone_mgmt_ioctlBLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl processing.* Called from blkdev_ioctl.