1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>journal_get_undo_access</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-journal-get-create-access.html" title="journal_get_create_access"><link rel="next" href="API-journal-dirty-data.html" title="journal_dirty_data"></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">journal_get_undo_access</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-journal-get-create-access.html">Prev</a> </td><th width="60%" align="center">Transasction Level</th><td width="20%" align="right"> <a accesskey="n" href="API-journal-dirty-data.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-journal-get-undo-access"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>journal_get_undo_access — 2 Notify intent to modify metadata with non-rewindable consequences 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">journal_get_undo_access </b>(</code></td><td>handle_t * <var class="pdparam">handle</var>, </td></tr><tr><td> </td><td>struct buffer_head * <var class="pdparam">bh</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1103898556"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>handle</code></em></span></dt><dd><p> 4 transaction 5 </p></dd><dt><span class="term"><em class="parameter"><code>bh</code></em></span></dt><dd><p> 6 buffer to undo 7 </p></dd></dl></div></div><div class="refsect1"><a name="idp1103901164"></a><h2>Description</h2><p> 8 Sometimes there is a need to distinguish between metadata which has 9 been committed to disk and that which has not. The ext3fs code uses 10 this for freeing and allocating space, we have to make sure that we 11 do not reuse freed space until the deallocation has been committed, 12 since if we overwrote that space we would make the delete 13 un-rewindable in case of a crash. 14 </p><p> 15 16 To deal with that, journal_get_undo_access requests write access to a 17 buffer for parts of non-rewindable operations such as delete 18 operations on the bitmaps. The journaling code must keep a copy of 19 the buffer's contents prior to the undo_access call until such time 20 as we know that the buffer has definitely been committed to disk. 21 </p><p> 22 23 We never need to know which transaction the committed data is part 24 of, buffers touched here are guaranteed to be dirtied later and so 25 will be committed to a new transaction in due course, at which point 26 we can discard the old committed data pointer. 27 </p><p> 28 29 Returns error number or 0 on success. 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-journal-get-create-access.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-journal-dirty-data.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">journal_get_create_access</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">journal_dirty_data</span></td></tr></table></div></body></html> 31