---
name: "blkdev_issue_zeroout"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/blkdev_issue_zeroout"
---

# blkdev\_issue\_zeroout(9)

zero-fill a block range

## NAME

blkdev\_issue\_zeroout - zero-fill a block range

## SYNOPSIS

**int blkdev\_issue\_zeroout(struct block\_device \*** *bdev***, sector\_t** *sector***, sector\_t** *nr\_sects***, gfp\_t** *gfp\_mask***, bool** *discard***);**

## ARGUMENTS

*bdev*

blockdev 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
