table of contents
other versions
- stretch 4.9.168-1
BLKDEV_ISSUE_ZEROOUT(9) | Block Devices | BLKDEV_ISSUE_ZEROOUT(9) |
NAME¶
blkdev_issue_zeroout - zero-fill a block rangeSYNOPSIS¶
int blkdev_issue_zeroout(struct block_device * bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, bool discard);
ARGUMENTS¶
bdevblockdev to write
sector
start sector
nr_sects
number of sectors to write
gfp_mask
memory allocation flags (for bio_alloc)
discard
whether to discard the block range
DESCRIPTION¶
Zero-fill a block range. If the discard flag is set and the block device guarantees that subsequent READ operations to the block range in question will return zeroes, the blocks will be discarded. Should the discard request fail, if the discard flag is not set, or if discard_zeroes_data is not supported, this function will resort to zeroing the blocks manually, thus provisioning (allocating, anchoring) them. If the block device supports the WRITE SAME command blkdev_issue_zeroout will use it to optimize the process of clearing the block range. Otherwise the zeroing will be performed using regular WRITE calls.COPYRIGHT¶
April 2019 | Kernel Hackers Manual 4.9. |