Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lkdev_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

Proto:int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, unsigned flags)

Type:int

Parameter:

TypeParameterName
struct block_device *bdev
sector_tsector
sector_tnr_sects
gfp_tgfp_mask
unsignedflags
361  ret = 0
365  try_write_zeroes = Not Not bdev_write_zeroes_sectors(bdev)
367  bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1
368  If (sector | nr_sects) & bs_mask Then Return -EINVAL
371  retry :
372  bio = NULL
373  lk_start_plug - initialize blk_plug and track it inside the task_struct*@plug: The &struct blk_plug that needs to be initialized* Description:* blk_start_plug() indicates to the block layer an intent by the caller
374  If try_write_zeroes Then
375  ret = __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp_mask, & bio, flags)
377  Else if Not (flags & don't write explicit zeroes ) Then
378  ret = __blkdev_issue_zero_pages(bdev, sector, nr_sects, gfp_mask, & bio)
380  Else
382  ret = -EOPNOTSUPP
384  If ret == 0 && bio Then
385  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()
386  _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.
388  lk_finish_plug - mark the end of a batch of submitted I/O*@plug: The &struct blk_plug passed to blk_start_plug()* Description:* Indicate that a batch of I/O submissions is complete. This function* must be paired with an initial call to blk_start_plug()
389  If ret && try_write_zeroes Then
390  If Not (flags & don't write explicit zeroes ) Then
391  try_write_zeroes = false
392  Go to retry
394  If Not bdev_write_zeroes_sectors(bdev) Then
401  ret = -EOPNOTSUPP
405  Return ret
Caller
NameDescribe
blk_ioctl_zeroout
blkdev_fallocate
__dax_zero_page_range