1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>bdev_write_page</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Filesystems API"><link rel="up" href="other_functions.html" title="Other Functions"><link rel="prev" href="API-bdev-read-page.html" title="bdev_read_page"><link rel="next" href="API-bdev-direct-access.html" title="bdev_direct_access"></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">bdev_write_page</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-bdev-read-page.html">Prev</a>&#160;</td><th width="60%" align="center">Other Functions</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-bdev-direct-access.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-bdev-write-page"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>bdev_write_page &#8212; 
2     Start writing a page to a block device
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">bdev_write_page </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>struct page * <var class="pdparam">page</var>, </td></tr><tr><td>&#160;</td><td>struct writeback_control * <var class="pdparam">wbc</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1102864748"></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     The device to write the page to
5    </p></dd><dt><span class="term"><em class="parameter"><code>sector</code></em></span></dt><dd><p>
6     The offset on the device to write the page to (need not be aligned)
7    </p></dd><dt><span class="term"><em class="parameter"><code>page</code></em></span></dt><dd><p>
8     The page to write
9    </p></dd><dt><span class="term"><em class="parameter"><code>wbc</code></em></span></dt><dd><p>
10     The writeback_control for the write
11    </p></dd></dl></div></div><div class="refsect1"><a name="idp1102869492"></a><h2>Description</h2><p>
12   On entry, the page should be locked and not currently under writeback.
13   On exit, if the write started successfully, the page will be unlocked and
14   under writeback.  If the write failed already (eg the driver failed to
15   queue the page to the device), the page will still be locked.  If the
16   caller is a -&gt;writepage implementation, it will need to unlock the page.
17   </p><p>
18
19   Errors returned by this function are usually <span class="quote">&#8220;<span class="quote">soft</span>&#8221;</span>, eg out of memory, or
20   queue full; callers should try a different route to write this page rather
21   than propagate an error back up the stack.
22</p></div><div class="refsect1"><a name="idp1102871268"></a><h2>Return</h2><p>
23   negative errno if an error occurs, 0 if submission was successful.
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-bdev-read-page.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="other_functions.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-bdev-direct-access.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">bdev_read_page</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">bdev_direct_access</span></td></tr></table></div></body></html>
25