<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><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.76.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><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>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" title="freeze_bdev"><a id="API-freeze-bdev"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>freeze_bdev — - lock a filesystem and force it into a consistent state </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">struct super_block * <strong>fsfuncfreeze_bdev </strong>(</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" title="Arguments"><a id="id2759045"></a><h2>Arguments</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>bdev</code></em></span></dt><dd><p> blockdevice to lock </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2759072"></a><h2>Description</h2><p> If a superblock is found on this device, we take the s_umount semaphore on it to make sure nobody unmounts until the snapshot creation is done. The reference counter (bd_fsfreeze_count) guarantees that only the last unfreeze process can unfreeze the frozen filesystem actually when multiple freeze requests arrive simultaneously. It counts up in <code class="function">freeze_bdev</code> and count down in <code class="function">thaw_bdev</code>. When it becomes 0, <code class="function">thaw_bdev</code> will unfreeze actually. </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>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>thaw_bdev</span></td></tr></table></div></body></html>