1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>blkdev_issue_zeroout</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="blkdev.html" title="Chapter&#160;14.&#160;Block Devices"><link rel="prev" href="API-blkdev-issue-write-same.html" title="blkdev_issue_write_same"><link rel="next" href="API-blk-queue-find-tag.html" title="blk_queue_find_tag"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">blkdev_issue_zeroout</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-blkdev-issue-write-same.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;14.&#160;Block Devices</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-blk-queue-find-tag.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-blkdev-issue-zeroout"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>blkdev_issue_zeroout &#8212; 
2     zero-fill a block range
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">blkdev_issue_zeroout </b>(</code></td><td>struct block_device * <var class="pdparam">bdev</var>, </td></tr><tr><td>&#160;</td><td>sector_t <var class="pdparam">sector</var>, </td></tr><tr><td>&#160;</td><td>sector_t <var class="pdparam">nr_sects</var>, </td></tr><tr><td>&#160;</td><td>gfp_t <var class="pdparam">gfp_mask</var>, </td></tr><tr><td>&#160;</td><td>bool <var class="pdparam">discard</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1128691868"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>bdev</code></em></span></dt><dd><p>
4     blockdev to write
5    </p></dd><dt><span class="term"><em class="parameter"><code>sector</code></em></span></dt><dd><p>
6     start sector
7    </p></dd><dt><span class="term"><em class="parameter"><code>nr_sects</code></em></span></dt><dd><p>
8     number of sectors to write
9    </p></dd><dt><span class="term"><em class="parameter"><code>gfp_mask</code></em></span></dt><dd><p>
10     memory allocation flags (for bio_alloc)
11    </p></dd><dt><span class="term"><em class="parameter"><code>discard</code></em></span></dt><dd><p>
12     whether to discard the block range
13    </p></dd></dl></div></div><div class="refsect1"><a name="idp1128697612"></a><h2>Description</h2><p>
14   Zero-fill a block range.  If the discard flag is set and the block
15   device guarantees that subsequent READ operations to the block range
16   in question will return zeroes, the blocks will be discarded. Should
17   the discard request fail, if the discard flag is not set, or if
18   discard_zeroes_data is not supported, this function will resort to
19   zeroing the blocks manually, thus provisioning (allocating,
20   anchoring) them. If the block device supports the WRITE SAME command
21   <code class="function">blkdev_issue_zeroout</code> will use it to optimize the process of
22   clearing the block range. Otherwise the zeroing will be performed
23   using regular WRITE calls.
24</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-blkdev-issue-write-same.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="blkdev.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-blk-queue-find-tag.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">blkdev_issue_write_same</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">blk_queue_find_tag</span></td></tr></table></div></body></html>
25