Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-lib.c Create Date:2022-07-28 17:07:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__blkdev_issue_write_zeroes

Proto:static int __blkdev_issue_write_zeroes(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, struct bio **biop, unsigned flags)

Type:int

Parameter:

TypeParameterName
struct block_device *bdev
sector_tsector
sector_tnr_sects
gfp_tgfp_mask
struct bio **biop
unsignedflags
216  bio = biop
218  q = bdev_get_queue(bdev)
220  If Not q Then Return -ENXIO
223  If bdev_read_only(bdev) Then Return -EPERM
227  max_write_zeroes_sectors = bdev_write_zeroes_sectors(bdev)
229  If max_write_zeroes_sectors == 0 Then Return -EOPNOTSUPP
232  When nr_sects cycle
233  bio = blk_next_bio(bio, 0, gfp_mask)
234  device address in 512 byte sectors = sector
235  bio_set_dev(bio, bdev)
236  bottom bits req flags, * top bits REQ_OP. Use * accessors. = REQ_OP_WRITE_ZEROES
237  If flags & do not free blocks Then bottom bits req flags, * top bits REQ_OP. Use * accessors. |= REQ_NOUNMAP
244  Else
246  nr_sects = 0
248  cond_resched()
251  biop = bio
252  Return 0
Caller
NameDescribe
__blkdev_issue_zeroout__blkdev_issue_zeroout - generate number of zero filed write bios*@bdev: blockdev to issue*@sector: start sector*@nr_sects: number of sectors to write*@gfp_mask: memory allocation flags (for bio_alloc)*@biop: pointer to anchor bio*@flags: controls
blkdev_issue_zerooutlkdev_issue_zeroout - zero-fill a block range*@bdev: blockdev to write*@sector: start sector*@nr_sects: number of sectors to write*@gfp_mask: memory allocation flags (for bio_alloc)*@flags: controls detailed behavior* Description:* Zero-fill a block