1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>freeze_super</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="registration_and_superblocks.html" title="Registration and Superblocks"><link rel="prev" href="API-get-super-thawed.html" title="get_super_thawed"><link rel="next" href="API-thaw-super.html" title="thaw_super"></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">freeze_super</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-get-super-thawed.html">Prev</a> </td><th width="60%" align="center">Registration and Superblocks</th><td width="20%" align="right"> <a accesskey="n" href="API-thaw-super.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-freeze-super"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>freeze_super — 2 lock the filesystem and force it into a consistent state 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">freeze_super </b>(</code></td><td>struct super_block * <var class="pdparam">sb</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1101929108"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>sb</code></em></span></dt><dd><p> 4 the super to lock 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1101930676"></a><h2>Description</h2><p> 6 Syncs the super to make sure the filesystem is consistent and calls the fs's 7 freeze_fs. Subsequent calls to this without first thawing the fs will return 8 -EBUSY. 9 </p><p> 10 11 During this function, sb->s_writers.frozen goes through these values: 12</p></div><div class="refsect1"><a name="idp1101931788"></a><h2>SB_UNFROZEN</h2><p> 13 File system is normal, all writes progress as usual. 14</p></div><div class="refsect1"><a name="idp1101932428"></a><h2>SB_FREEZE_WRITE</h2><p> 15 The file system is in the process of being frozen. New 16 writes should be blocked, though page faults are still allowed. We wait for 17 all writes to complete and then proceed to the next stage. 18</p></div><div class="refsect1"><a name="idp1101933212"></a><h2>SB_FREEZE_PAGEFAULT</h2><p> 19 Freezing continues. Now also page faults are blocked 20 but internal fs threads can still modify the filesystem (although they 21 should not dirty new pages or inodes), writeback can run etc. After waiting 22 for all running page faults we sync the filesystem which will clean all 23 dirty pages and inodes (no new dirty pages or inodes can be created when 24 sync is running). 25</p></div><div class="refsect1"><a name="idp1101934564"></a><h2>SB_FREEZE_FS</h2><p> 26 The file system is frozen. Now all internal sources of fs 27 modification are blocked (e.g. XFS preallocation truncation on inode 28 reclaim). This is usually implemented by blocking new transactions for 29 filesystems that have them and need this additional guard. After all 30 internal writers are finished we call -><code class="function">freeze_fs</code> to finish filesystem 31 freezing. Then we transition to SB_FREEZE_COMPLETE state. This state is 32 mostly auxiliary for filesystems to verify they do not modify frozen fs. 33 </p><p> 34 35 sb->s_writers.frozen is protected by sb->s_umount. 36</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-get-super-thawed.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="registration_and_superblocks.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-thaw-super.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">get_super_thawed</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">thaw_super</span></td></tr></table></div></body></html> 37