| Function report | 
| Source Code: block\blk-zoned.c | Create Date:2022-07-28 18:05:58 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name: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
Proto:int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, sector_t sector, sector_t nr_sectors, gfp_t gfp_mask)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct block_device * | bdev | |
| enum req_opf | op | |
| sector_t | sector | |
| sector_t | nr_sectors | |
| gfp_t | gfp_mask | 
| 160 | q = bdev_get_queue(bdev) | 
| 161 | zone_sectors = blk_queue_zone_sectors(q) | 
| 162 | capacity = get_capacity(bd_disk) | 
| 163 | end_sector = sector + nr_sectors | 
| 167 | If Not blk_queue_is_zoned(q) Then Return -EOPNOTSUPP | 
| 170 | If bdev_read_only(bdev) Then Return -EPERM | 
| 176 | If Not nr_sectors || end_sector > capacity Then Return -EINVAL | 
| 181 | If sector & zone_sectors - 1 Then Return -EINVAL | 
| 184 | If nr_sectors & zone_sectors - 1 && end_sector != capacity Then Return -EINVAL | 
| 187 | When sector < end_sector cycle | 
| 188 | bio = blk_next_bio(bio, 0, gfp_mask) | 
| 189 | bio_set_dev(bio, bdev) | 
| 195 | If op == REQ_OP_ZONE_RESET && blkdev_allow_reset_all_zones(bdev, sector, nr_sectors) Then | 
| 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() | 
| 212 | Return ret | 
| Name | Describe | 
|---|---|
| blkdev_zone_mgmt_ioctl | BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl processing.* Called from blkdev_ioctl. | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |