1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>sb_start_pagefault</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="vfs.html#the_filesystem_types" title="The Filesystem types"><link rel="prev" href="API-sb-start-write.html" title="sb_start_write"><link rel="next" href="API-inode-inc-iversion.html" title="inode_inc_iversion"></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">sb_start_pagefault</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-sb-start-write.html">Prev</a>&#160;</td><th width="60%" align="center">The Filesystem types</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-inode-inc-iversion.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-sb-start-pagefault"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sb_start_pagefault &#8212; 
2     get write access to a superblock from a page fault
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">void <b class="fsfunc">sb_start_pagefault </b>(</code></td><td>struct super_block * <var class="pdparam">sb</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1099084420"></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 we write to
5    </p></dd></dl></div></div><div class="refsect1"><a name="idp1099085980"></a><h2>Description</h2><p>
6   When a process starts handling write page fault, it should embed the
7   operation into <code class="function">sb_start_pagefault</code> - <code class="function">sb_end_pagefault</code> pair to get
8   exclusion against file system freezing. This is needed since the page fault
9   is going to dirty a page. This function increments number of running page
10   faults preventing freezing. If the file system is already frozen, the
11   function waits until the file system is thawed.
12   </p><p>
13
14   Since page fault freeze protection behaves as a lock, users have to preserve
15   ordering of freeze protection and other filesystem locks. It is advised to
16   put <code class="function">sb_start_pagefault</code> close to mmap_sem in lock ordering. Page fault
17</p></div><div class="refsect1"><a name="idp1099088412"></a><h2>handling code implies lock dependency</h2><p>
18   </p><p>
19
20   mmap_sem
21   -&gt; sb_start_pagefault
22</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-sb-start-write.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="vfs.html#the_filesystem_types">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-inode-inc-iversion.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">sb_start_write</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">inode_inc_iversion</span></td></tr></table></div></body></html>
23