1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>freeze_bdev</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-sync-inode-metadata.html" title="sync_inode_metadata"><link rel="next" href="API-thaw-bdev.html" title="thaw_bdev"></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_bdev</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-sync-inode-metadata.html">Prev</a> </td><th width="60%" align="center">Other Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-thaw-bdev.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-freeze-bdev"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>freeze_bdev — 2 - lock a 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">struct super_block * <b class="fsfunc">freeze_bdev </b>(</code></td><td>struct block_device * <var class="pdparam">bdev</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1102834644"></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 blockdevice to lock 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1102836260"></a><h2>Description</h2><p> 6 If a superblock is found on this device, we take the s_umount semaphore 7 on it to make sure nobody unmounts until the snapshot creation is done. 8 The reference counter (bd_fsfreeze_count) guarantees that only the last 9 unfreeze process can unfreeze the frozen filesystem actually when multiple 10 freeze requests arrive simultaneously. It counts up in <code class="function">freeze_bdev</code> and 11 count down in <code class="function">thaw_bdev</code>. When it becomes 0, <code class="function">thaw_bdev</code> will unfreeze 12 actually. 13</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-sync-inode-metadata.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="other_functions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-thaw-bdev.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">sync_inode_metadata</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_bdev</span></td></tr></table></div></body></html> 14