1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>jbd2__journal_start</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="functions.html#transaction_level" title="Transasction Level"><link rel="prev" href="API-jbd2-journal-skip-recovery.html" title="jbd2_journal_skip_recovery"><link rel="next" href="API-jbd2-journal-start-reserved.html" title="jbd2_journal_start_reserved"></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">jbd2__journal_start</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-jbd2-journal-skip-recovery.html">Prev</a> </td><th width="60%" align="center">Transasction Level</th><td width="20%" align="right"> <a accesskey="n" href="API-jbd2-journal-start-reserved.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-jbd2--journal-start"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>jbd2__journal_start — 
2  Obtain a new handle.
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">handle_t * <b class="fsfunc">jbd2__journal_start </b>(</code></td><td>journal_t * <var class="pdparam">journal</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">nblocks</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">rsv_blocks</var>, </td></tr><tr><td> </td><td>gfp_t <var class="pdparam">gfp_mask</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">type</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">line_no</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.8.5.4.2.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>journal</code></em></span></dt><dd><p>
4     Journal to start transaction on.
5    </p></dd><dt><span class="term"><em class="parameter"><code>nblocks</code></em></span></dt><dd><p>
6     number of block buffer we might modify
7    </p></dd><dt><span class="term"><em class="parameter"><code>rsv_blocks</code></em></span></dt><dd><p>
8     -- undescribed --
9    </p></dd><dt><span class="term"><em class="parameter"><code>gfp_mask</code></em></span></dt><dd><p>
10     -- undescribed --
11    </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p>
12     -- undescribed --
13    </p></dd><dt><span class="term"><em class="parameter"><code>line_no</code></em></span></dt><dd><p>
14     -- undescribed --
15    </p></dd></dl></div></div><div class="refsect1"><a name="id-1.8.5.4.2.6"></a><h2>Description</h2><p>
16   We make sure that the transaction can guarantee at least nblocks of
17   modified buffers in the log.  We block until the log can guarantee
18   that much space. Additionally, if rsv_blocks &gt; 0, we also create another
19   handle with rsv_blocks reserved blocks in the journal. This handle is
20   is stored in h_rsv_handle. It is not attached to any particular transaction
21   and thus doesn't block transaction commit. If the caller uses this reserved
22   handle, it has to set h_rsv_handle to NULL as otherwise <code class="function"><a class="link" href="API-jbd2-journal-stop.html" title="jbd2_journal_stop">jbd2_journal_stop</a></code>
23   on the parent handle will dispose the reserved one. Reserved handle has to
24   be converted to a normal handle using <code class="function"><a class="link" href="API-jbd2-journal-start-reserved.html" title="jbd2_journal_start_reserved">jbd2_journal_start_reserved</a></code> before
25   it can be used.
26   </p><p>
27
28   Return a pointer to a newly allocated handle, or an <code class="function">ERR_PTR</code> value
29   on failure.
30</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-jbd2-journal-skip-recovery.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="functions.html#transaction_level">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-jbd2-journal-start-reserved.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">jbd2_journal_skip_recovery</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">jbd2_journal_start_reserved</span></td></tr></table></div></body></html>
31