linux/fs/fuse/control.c
<<
4opt v/spa v/form va 4opt href="../linux+v3u <7/fs/fuse/control.c">4opt vimg src="../.static/gfx/right.png" alt=">>">4ov/spa 4ovspa class="lxr_search">4opt4opt vinput typionhidden" namionnavtarget" /option">4opt vinput typiontext" namionsearch" idonsearch">4opt vbutt12Search4opt Prefs v/a>4ov/spa pt v/div pt vform ac12" ="ajax+*" method="post" onsubmit="return false;">4ovinput typionhidden" namionajax_lookup" idonajax_lookup" /option">4pt v/form 4pt vdiv class="headingbott1m">
vdiv idonfile_contents"
   1v/a>vspa
 class="comment">/*v/spa
	    2v/a>vspa
 class="comment">  FUSE: Filesystem in Userspacev/spa
	    3v/a>vspa
 class="comment">  Copyright (C) 2001-2008  Miklos Szeredi <miklos@szeredi.hu>v/spa
	    4v/a>4   5v/a>vspa
 class="comment">  This program ca
 be distributed under the terms of the GNU GPL.v/spa
	    6v/a>vspa
 class="comment">  See the file COPYING.v/spa
	    7v/a>vspa
 class="comment">*/v/spa
	    8v/a>4   9v/a>#include "va href="fs/fuse/fuse_i.h" class="fref">fuse_i.hv/a>"4  8 4.a>4  11v/a>#include <va href="include/linux/init.h" class="fref">linux/init.hv/a>>4  12v/a>#include <va href="include/linux/module.h" class="fref">linux/module.hv/a>>4  134.a>4  14v/a>#define va href="+code=FUSE_CTL_SUPER_MAGIC" class="sref">FUSE_CTL_SUPER_MAGICv/a> 0x657355434  154.a>4  16v/a>vspa
 class="comment">/*v/spa
	   17v/a>vspa
 class="comment"> * This is non-NULL when the single instance of the control filesystemv/spa
	   18v/a>vspa
 class="comment"> * exists.  Protected by fuse_mutexv/spa
	   19v/a>vspa
 class="comment"> */v/spa
	   2 4.a>static struct va href="+code=super_block" class="sref">super_blockv/a> *va href="+code=fuse_control_sb" class="sref">fuse_control_sbv/a>;4  214.a>4  224.a>static struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fuse_ctl_file_conn_get" class="sref">fuse_ctl_file_conn_getv/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>)4  234.a>{4  24v/a>        struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a>;4  25v/a>        va href="+code=mutex_lock" class="sref">mutex_lockv/a>(&va href="+code=fuse_mutex" class="sref">fuse_mutexv/a>);4  26v/a>        va href="+code=fc" class="sref">fcv/a> = va href="+code=file" class="sref">filev/a>->va href="+code=f_path" class="sref">f_pathv/a>.va href="+code=dentry" class="sref">dentryv/a>->va href="+code=d_inode" class="sref">d_inodev/a>->va href="+code=i_private" class="sref">i_privatev/a>;4  27v/a>        if (va href="+code=fc" class="sref">fcv/a>)4  28v/a>                va href="+code=fc" class="sref">fcv/a> = va href="+code=fuse_conn_get" class="sref">fuse_conn_getv/a>(va href="+code=fc" class="sref">fcv/a>);4  29v/a>        va href="+code=mutex_unlock" class="sref">mutex_unlockv/a>(&va href="+code=fuse_mutex" class="sref">fuse_mutexv/a>);4  30v/a>        return va href="+code=fc" class="sref">fcv/a>;4  314.a>}4  324.a>4  334.a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_abort_write" class="sref">fuse_conn_abort_writev/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>, const char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>,4  34v/a>                                     va href="+code=size_t" class="sref">size_tv/a> va href="+code=count" class="sref">countv/a>, va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>)4  354.a>{4  36v/a>        struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a> = va href="+code=fuse_ctl_file_conn_get" class="sref">fuse_ctl_file_conn_getv/a>(va href="+code=file" class="sref">filev/a>);4  37v/a>        if (va href="+code=fc" class="sref">fcv/a>) {4  38v/a>                va href="+code=fuse_abort_conn" class="sref">fuse_abort_connv/a>(va href="+code=fc" class="sref">fcv/a>);4  39v/a>                va href="+code=fuse_conn_put" class="sref">fuse_conn_putv/a>(va href="+code=fc" class="sref">fcv/a>);4  40v/a>        }4  41v/a>        return va href="+code=count" class="sref">countv/a>;4  424.a>}4  434.a>4  444.a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_waiting_read" class="sref">fuse_conn_waiting_readv/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>, char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>,4  45v/a>                                      va href="+code=size_t" class="sref">size_tv/a> va href="+code=len" class="sref">lenv/a>, va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>)4  464.a>{4  47v/a>        char va href="+code=tmp" class="sref">tmpv/a>[32];4  48v/a>        va href="+code=size_t" class="sref">size_tv/a> va href="+code=size" class="sref">sizev/a>;4  49v/a>4  50v/a>        if (!*va href="+code=ppos" class="sref">pposv/a>) {4  51v/a>                long va href="+code=/opti" class="sref">/optiv/a>;4  52v/a>                struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a> = va href="+code=fuse_ctl_file_conn_get" class="sref">fuse_ctl_file_conn_getv/a>(va href="+code=file" class="sref">filev/a>);4  53v/a>                if (!va href="+code=fc" class="sref">fcv/a>)4  54v/a>                        return 0;4  554.a>4  56v/a>                va href="+code=/opti" class="sref">/optiv/a> = va href="+code=atomic_read" class="sref">atomic_readv/a>(&va href="+code=fc" class="sref">fcv/a>->va href="+code=num_waiting" class="sref">num_waitingv/a>);4  57v/a>                va href="+code=file" class="sref">filev/a>->va href="+code=private_data" class="sref">private_datav/a> = (void *)va href="+code=/opti" class="sref">/optiv/a>;4  58v/a>                va href="+code=fuse_conn_put" class="sref">fuse_conn_putv/a>(va href="+code=fc" class="sref">fcv/a>);4  59v/a>        }4  60v/a>        va href="+code=size" class="sref">sizev/a> = va href="+code=sprintf" class="sref">sprintfv/a>(va href="+code=tmp" class="sref">tmpv/a>, vspa
 class="string">"%ld\n"v/spa
	, (long)va href="+code=file" class="sref">filev/a>->va href="+code=private_data" class="sref">private_datav/a>);4  61v/a>        return va href="+code=simple_read_from_buffer" class="sref">simple_read_from_bufferv/a>(va href="+code=buf" class="sref">bufv/a>, va href="+code=len" class="sref">lenv/a>, va href="+code=ppos" class="sref">pposv/a>, va href="+code=tmp" class="sref">tmpv/a>, va href="+code=size" class="sref">sizev/a>);4  624.a>}4  634.a>4  644.a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_limit_read" class="sref">fuse_conn_limit_readv/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>, char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>,4  65v/a>                                    va href="+code=size_t" class="sref">size_tv/a> va href="+code=len" class="sref">lenv/a>, va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>, unsigned va href="+code=/op" class="sref">/opv/a>)4  664.a>{4  67v/a>        char va href="+code=tmp" class="sref">tmpv/a>[32];4  68v/a>        va href="+code=size_t" class="sref">size_tv/a> va href="+code=size" class="sref">sizev/a> = va href="+code=sprintf" class="sref">sprintfv/a>(va href="+code=tmp" class="sref">tmpv/a>, vspa
 class="string">"%u\n"v/spa
	, va href="+code=/op" class="sref">/opv/a>);4  69v/a>4  70v/a>        return va href="+code=simple_read_from_buffer" class="sref">simple_read_from_bufferv/a>(va href="+code=buf" class="sref">bufv/a>, va href="+code=len" class="sref">lenv/a>, va href="+code=ppos" class="sref">pposv/a>, va href="+code=tmp" class="sref">tmpv/a>, va href="+code=size" class="sref">sizev/a>);4  714.a>}4  724.a>4  734.a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_limit_write" class="sref">fuse_conn_limit_writev/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>, const char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>,4  74v/a>                                     va href="+code=size_t" class="sref">size_tv/a> va href="+code=count" class="sref">countv/a>, va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>, unsigned *va href="+code=/op" class="sref">/opv/a>,4  75v/a>                                     unsigned va href="+code=global_limit" class="sref">global_limitv/a>)4  764.a>{4  77v/a>        unsigned long va href="+code=t" class="sref">tv/a>;4  78v/a>        unsigned va href="+code=limit" class="sref">limitv/a> = (1 << 16) - 1;4  79v/a>        int va href="+code=err" class="sref">errv/a>;4  8 4.a>4  81v/a>        if (*va href="+code=ppos" class="sref">pposv/a>)4  82v/a>                return -va href="+code=EINVAL" class="sref">EINVALv/a>;4  834.a>4  84v/a>        va href="+code=err" class="sref">errv/a> = va href="+code=kstrtoul_from_user" class="sref">kstrtoul_from_userv/a>(va href="+code=buf" class="sref">bufv/a>, va href="+code=count" class="sref">countv/a>, 0, &va href="+code=t" class="sref">tv/a>);4  85v/a>        if (va href="+code=err" class="sref">errv/a>)4  86v/a>                return va href="+code=err" class="sref">errv/a>;4  874.a>4  88v/a>        if (!va href="+code=capable" class="sref">capablev/a>(va href="+code=CAP_SYS_ADMIN" class="sref">CAP_SYS_ADMINv/a>))4  89v/a>                va href="+code=limit" class="sref">limitv/a> = va href="+code=min" class="sref">minv/a>(va href="+code=limit" class="sref">limitv/a>, va href="+code=global_limit" class="sref">global_limitv/a>);4  9 4.a>4  91v/a>        if (va href="+code=t" class="sref">tv/a> > va href="+code=limit" class="sref">limitv/a>)4  92v/a>                return -va href="+code=EINVAL" class="sref">EINVALv/a>;4  934.a>4  94v/a>        *va href="+code=/op" class="sref">/opv/a> = va href="+code=t" class="sref">tv/a>;4  954.a>4  96v/a>        return va href="+code=count" class="sref">countv/a>;4  974.a>}4  98v/a>4  994.a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_max_background_read" class="sref">fuse_conn_max_background_readv/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>,4 100v/a>                                             char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>, va href="+code=size_t" class="sref">size_tv/a> va href="+code=len" class="sref">lenv/a>,4 101v/a>                                             va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>)4 1024.a>{4 103v/a>        struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a>;4 104v/a>        unsigned va href="+code=/op" class="sref">/opv/a>;4 1054.a>4 106v/a>        va href="+code=fc" class="sref">fcv/a> = va href="+code=fuse_ctl_file_conn_get" class="sref">fuse_ctl_file_conn_getv/a>(va href="+code=file" class="sref">filev/a>);4 107v/a>        if (!va href="+code=fc" class="sref">fcv/a>)4 108v/a>                return 0;4 109v/a>4 110v/a>        va href="+code=/op" class="sref">/opv/a> = va href="+code=fc" class="sref">fcv/a>->va href="+code=max_background" class="sref">max_backgroundv/a>;4 111v/a>        va href="+code=fuse_conn_put" class="sref">fuse_conn_putv/a>(va href="+code=fc" class="sref">fcv/a>);4 1124.a>4 113v/a>        return va href="+code=fuse_conn_limit_read" class="sref">fuse_conn_limit_readv/a>(va href="+code=file" class="sref">filev/a>, va href="+code=buf" class="sref">bufv/a>, va href="+code=len" class="sref">lenv/a>, va href="+code=ppos" class="sref">pposv/a>, va href="+code=/op" class="sref">/opv/a>);4 114v/a>}4 1154.a>4 116v/a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_max_background_write" class="sref">fuse_conn_max_background_writev/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>,4 117v/a>                                              const char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>,4 118v/a>                                              va href="+code=size_t" class="sref">size_tv/a> va href="+code=count" class="sref">countv/a>, va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>)4 119v/a>{4 120v/a>        unsigned va href="+code=uninitialized_var" class="sref">uninitialized_varv/a>(va href="+code=/op" class="sref">/opv/a>);4 121v/a>        va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=ret" class="sref">retv/a>;4 1224.a>4 123v/a>        va href="+code=ret" class="sref">retv/a> = va href="+code=fuse_conn_limit_write" class="sref">fuse_conn_limit_writev/a>(va href="+code=file" class="sref">filev/a>, va href="+code=buf" class="sref">bufv/a>, va href="+code=count" class="sref">countv/a>, va href="+code=ppos" class="sref">pposv/a>, &va href="+code=/op" class="sref">/opv/a>,4 124v/a>                                    va href="+code=max_user_bgreq" class="sref">max_user_bgreqv/a>);4 125v/a>        if (va href="+code=ret" class="sref">retv/a> > 0) {4 126v/a>                struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a> = va href="+code=fuse_ctl_file_conn_get" class="sref">fuse_ctl_file_conn_getv/a>(va href="+code=file" class="sref">filev/a>);4 127v/a>                if (va href="+code=fc" class="sref">fcv/a>) {4 128v/a>                        va href="+code=fc" class="sref">fcv/a>->va href="+code=max_background" class="sref">max_backgroundv/a> = va href="+code=/op" class="sref">/opv/a>;4 129v/a>                        va href="+code=fuse_conn_put" class="sref">fuse_conn_putv/a>(va href="+code=fc" class="sref">fcv/a>);4 130v/a>                }4 131v/a>        }4 1324.a>4 133v/a>        return va href="+code=ret" class="sref">retv/a>;4 134v/a>}4 1354.a>4 136v/a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_conges12"
_threshold_read" class="sref">fuse_conn_conges12"
_threshold_readv/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>,4 137v/a>                                                   char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>, va href="+code=size_t" class="sref">size_tv/a> va href="+code=len" class="sref">lenv/a>,4 138v/a>                                                   va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>)4 139v/a>{4 140v/a>        struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a>;4 141v/a>        unsigned va href="+code=/op" class="sref">/opv/a>;4 1424.a>4 143v/a>        va href="+code=fc" class="sref">fcv/a> = va href="+code=fuse_ctl_file_conn_get" class="sref">fuse_ctl_file_conn_getv/a>(va href="+code=file" class="sref">filev/a>);4 144v/a>        if (!va href="+code=fc" class="sref">fcv/a>)4 145v/a>                return 0;4 1464.a>4 147v/a>        va href="+code=/op" class="sref">/opv/a> = va href="+code=fc" class="sref">fcv/a>->va href="+code=conges12"
_threshold" class="sref">conges12"
_thresholdv/a>;4 148v/a>        va href="+code=fuse_conn_put" class="sref">fuse_conn_putv/a>(va href="+code=fc" class="sref">fcv/a>);4 149v/a>4 150v/a>        return va href="+code=fuse_conn_limit_read" class="sref">fuse_conn_limit_readv/a>(va href="+code=file" class="sref">filev/a>, va href="+code=buf" class="sref">bufv/a>, va href="+code=len" class="sref">lenv/a>, va href="+code=ppos" class="sref">pposv/a>, va href="+code=/op" class="sref">/opv/a>);4 1514.a>}4 1524.a>4 1534.a>static va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=fuse_conn_conges12"
_threshold_write" class="sref">fuse_conn_conges12"
_threshold_writev/a>(struct va href="+code=file" class="sref">filev/a> *va href="+code=file" class="sref">filev/a>,4 154v/a>                                                    const char va href="+code=__user" class="sref">__userv/a> *va href="+code=buf" class="sref">bufv/a>,4 155v/a>                                                    va href="+code=size_t" class="sref">size_tv/a> va href="+code=count" class="sref">countv/a>, va href="+code=loff_t" class="sref">loff_tv/a> *va href="+code=ppos" class="sref">pposv/a>)4 1564.a>{4 157v/a>        unsigned va href="+code=uninitialized_var" class="sref">uninitialized_varv/a>(va href="+code=/op" class="sref">/opv/a>);4 158v/a>        va href="+code=ssize_t" class="sref">ssize_tv/a> va href="+code=ret" class="sref">retv/a>;4 159v/a>4 160v/a>        va href="+code=ret" class="sref">retv/a> = va href="+code=fuse_conn_limit_write" class="sref">fuse_conn_limit_writev/a>(va href="+code=file" class="sref">filev/a>, va href="+code=buf" class="sref">bufv/a>, va href="+code=count" class="sref">countv/a>, va href="+code=ppos" class="sref">pposv/a>, &va href="+code=/op" class="sref">/opv/a>,4 161v/a>                                    va href="+code=max_user_congthresh" class="sref">max_user_congthreshv/a>);4 162v/a>        if (va href="+code=ret" class="sref">retv/a> > 0) {4 163v/a>                struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a> = va href="+code=fuse_ctl_file_conn_get" class="sref">fuse_ctl_file_conn_getv/a>(va href="+code=file" class="sref">filev/a>);4 164v/a>                if (va href="+code=fc" class="sref">fcv/a>) {4 165v/a>                        va href="+code=fc" class="sref">fcv/a>->va href="+code=conges12"
_threshold" class="sref">conges12"
_thresholdv/a> = va href="+code=/op" class="sref">/opv/a>;4 166v/a>                        va href="+code=fuse_conn_put" class="sref">fuse_conn_putv/a>(va href="+code=fc" class="sref">fcv/a>);4 167v/a>                }4 168v/a>        }4 169v/a>4 170v/a>        return va href="+code=ret" class="sref">retv/a>;4 1714.a>}4 1724.a>4 1734.a>static const struct va href="+code=file_opera12"
s" class="sref">file_opera12"
sv/a> va href="+code=fuse_ctl_abort_ops" class="sref">fuse_ctl_abort_opsv/a> = {4 174v/a>        .va href="+code=open" class="sref">openv/a> = va href="+code=n"
seekable_open" class="sref">n"
seekable_openv/a>,4 175v/a>        .va href="+code=write" class="sref">writev/a> = va href="+code=fuse_conn_abort_write" class="sref">fuse_conn_abort_writev/a>,4 176v/a>        .va href="+code=llseek" class="sref">llseekv/a> = va href="+code=n"_llseek" class="sref">n"_llseekv/a>,4 177v/a>};4 178v/a>4 1794.a>static const struct va href="+code=file_opera12"
s" class="sref">file_opera12"
sv/a> va href="+code=fuse_ctl_waiting_ops" class="sref">fuse_ctl_waiting_opsv/a> = {4 180v/a>        .va href="+code=open" class="sref">openv/a> = va href="+code=n"
seekable_open" class="sref">n"
seekable_openv/a>,4 181v/a>        .va href="+code=read" class="sref">readv/a> = va href="+code=fuse_conn_waiting_read" class="sref">fuse_conn_waiting_readv/a>,4 182v/a>        .va href="+code=llseek" class="sref">llseekv/a> = va href="+code=n"_llseek" class="sref">n"_llseekv/a>,4 1834.a>};4 184v/a>4 185v/a>static const struct va href="+code=file_opera12"
s" class="sref">file_opera12"
sv/a> va href="+code=fuse_conn_max_background_ops" class="sref">fuse_conn_max_background_opsv/a> = {4 186v/a>        .va href="+code=open" class="sref">openv/a> = va href="+code=n"
seekable_open" class="sref">n"
seekable_openv/a>,4 187v/a>        .va href="+code=read" class="sref">readv/a> = va href="+code=fuse_conn_max_background_read" class="sref">fuse_conn_max_background_readv/a>,4 188v/a>        .va href="+code=write" class="sref">writev/a> = va href="+code=fuse_conn_max_background_write" class="sref">fuse_conn_max_background_writev/a>,4 189v/a>        .va href="+code=llseek" class="sref">llseekv/a> = va href="+code=n"_llseek" class="sref">n"_llseekv/a>,4 19 4.a>};4 1914.a>4 192v/a>static const struct va href="+code=file_opera12"
s" class="sref">file_opera12"
sv/a> va href="+code=fuse_conn_conges12"
_threshold_ops" class="sref">fuse_conn_conges12"
_threshold_opsv/a> = {4 193v/a>        .va href="+code=open" class="sref">openv/a> = va href="+code=n"
seekable_open" class="sref">n"
seekable_openv/a>,4 194v/a>        .va href="+code=read" class="sref">readv/a> = va href="+code=fuse_conn_conges12"
_threshold_read" class="sref">fuse_conn_conges12"
_threshold_readv/a>,4 195v/a>        .va href="+code=write" class="sref">writev/a> = va href="+code=fuse_conn_conges12"
_threshold_write" class="sref">fuse_conn_conges12"
_threshold_writev/a>,4 196v/a>        .va href="+code=llseek" class="sref">llseekv/a> = va href="+code=n"_llseek" class="sref">n"_llseekv/a>,4 197v/a>};4 198v/a>4 1994.a>static struct va href="+code=dentry" class="sref">dentryv/a> *va href="+code=fuse_ctl_add_dentry" class="sref">fuse_ctl_add_dentryv/a>(struct va href="+code=dentry" class="sref">dentryv/a> *va href="+code=parent" class="sref">parentv/a>,4 200v/a>                                          struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a>,4 201v/a>                                          const char *va href="+code=nami" class="sref">namiv/a>,4 202v/a>                                          int va href="+code=mode" class="sref">modev/a>, int va href="+code=nlink" class="sref">nlinkv/a>,4 203v/a>                                          const struct va href="+code=inode_opera12"
s" class="sref">inode_opera12"
sv/a> *va href="+code=iop" class="sref">iopv/a>,4 204v/a>                                          const struct va href="+code=file_opera12"
s" class="sref">file_opera12"
sv/a> *va href="+code=fop" class="sref">fopv/a>)4 2054.a>{4 206v/a>        struct va href="+code=dentry" class="sref">dentryv/a> *va href="+code=dentry" class="sref">dentryv/a>;4 207v/a>        struct va href="+code=inode" class="sref">inodev/a> *va href="+code=inode" class="sref">inodev/a>;4 208v/a>4 209v/a>        va href="+code=BUG_ON" class="sref">BUG_ONv/a>(va href="+code=fc" class="sref">fcv/a>->va href="+code=ctl_ndents" class="sref">ctl_ndentsv/a> >= va href="+code=FUSE_CTL_NUM_DENTRIES" class="sref">FUSE_CTL_NUM_DENTRIESv/a>);4 210v/a>        va href="+code=dentry" class="sref">dentryv/a> = va href="+code=d_alloc_nami" class="sref">d_alloc_namiv/a>(va href="+code=parent" class="sref">parentv/a>, va href="+code=nami" class="sref">namiv/a>);4 211v/a>        if (!va href="+code=dentry" class="sref">dentryv/a>)4 212v/a>                return va href="+code=NULL" class="sref">NULLv/a>;4 2134.a>4 214v/a>        va href="+code=fc" class="sref">fcv/a>->va href="+code=ctl_dentry" class="sref">ctl_dentryv/a>[va href="+code=fc" class="sref">fcv/a>->va href="+code=ctl_ndents" class="sref">ctl_ndentsv/a>++] = va href="+code=dentry" class="sref">dentryv/a>;4 215v/a>        va href="+code=inode" class="sref">inodev/a> = va href="+code=new_inode" class="sref">new_inodev/a>(va href="+code=fuse_control_sb" class="sref">fuse_control_sbv/a>);4 216v/a>        if (!va href="+code=inode" class="sref">inodev/a>)4 217v/a>                return va href="+code=NULL" class="sref">NULLv/a>;4 218v/a>4 219v/a>        va href="+code=inode" class="sref">inodev/a>->va href="+code=i_ino" class="sref">i_inov/a> = va href="+code=get_next_ino" class="sref">get_next_inov/a>();4 220v/a>        va href="+code=inode" class="sref">inodev/a>->va href="+code=i_mode" class="sref">i_modev/a> = va href="+code=mode" class="sref">modev/a>;4 221v/a>        va href="+code=inode" class="sref">inodev/a>->va href="+code=i_uid" class="sref">i_uidv/a> = va href="+code=fc" class="sref">fcv/a>->va href="+code=user_id" class="sref">user_idv/a>;4 222v/a>        va href="+code=inode" class="sref">inodev/a>->va href="+code=i_gid" class="sref">i_gidv/a> = va href="+code=fc" class="sref">fcv/a>->va href="+code=group_id" class="sref">group_idv/a>;4 223v/a>        va href="+code=inode" class="sref">inodev/a>->va href="+code=i_a12mi" class="sref">i_a12miv/a> = va href="+code=inode" class="sref">inodev/a>->va href="+code=i_m12mi" class="sref">i_m12miv/a> = va href="+code=inode" class="sref">inodev/a>->va href="+code=i_c12mi" class="sref">i_c12miv/a> = va href="+code=CURRENT_TIME" class="sref">CURRENT_TIMEv/a>;4 224v/a>        vspa
 class="comment">/* setting ->i_op to NULL is not allowed */v/spa
	4 225v/a>        if (va href="+code=iop" class="sref">iopv/a>)4 226v/a>                va href="+code=inode" class="sref">inodev/a>->va href="+code=i_op" class="sref">i_opv/a> = va href="+code=iop" class="sref">iopv/a>;4 227v/a>        va href="+code=inode" class="sref">inodev/a>->va href="+code=i_fop" class="sref">i_fopv/a> = va href="+code=fop" class="sref">fopv/a>;4 228v/a>        va href="+code=set_nlink" class="sref">set_nlinkv/a>(va href="+code=inode" class="sref">inodev/a>, va href="+code=nlink" class="sref">nlinkv/a>);4 229v/a>        va href="+code=inode" class="sref">inodev/a>->va href="+code=i_private" class="sref">i_privatev/a> = va href="+code=fc" class="sref">fcv/a>;4 230v/a>        va href="+code=d_add" class="sref">d_addv/a>(va href="+code=dentry" class="sref">dentryv/a>, va href="+code=inode" class="sref">inodev/a>);4 231v/a>        return va href="+code=dentry" class="sref">dentryv/a>;4 2324.a>}4 2334.a>4 234v/a>vspa
 class="comment">/*v/spa
	4 2354.a>vspa
 class="comment"> * Add a connec12"
 to the control filesystem (if it exists).  Callerv/spa
	4 236v/a>vspa
 class="comment"> * must hold fuse_mutexv/spa
	4 237v/a>vspa
 class="comment"> */v/spa
	4 238v/a>int va href="+code=fuse_ctl_add_conn" class="sref">fuse_ctl_add_connv/a>(struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a>)4 239v/a>{4 240v/a>        struct va href="+code=dentry" class="sref">dentryv/a> *va href="+code=parent" class="sref">parentv/a>;4 241v/a>        char va href="+code=nami" class="sref">namiv/a>[32];4 2424.a>4 243v/a>        if (!va href="+code=fuse_control_sb" class="sref">fuse_control_sbv/a>)4 244v/a>                return 0;4 2454.a>4 246v/a>        va href="+code=parent" class="sref">parentv/a> = va href="+code=fuse_control_sb" class="sref">fuse_control_sbv/a>->va href="+code=s_root" class="sref">s_rootv/a>;4 247v/a>        va href="+code=inc_nlink" class="sref">inc_nlinkv/a>(va href="+code=parent" class="sref">parentv/a>->va href="+code=d_inode" class="sref">d_inodev/a>);4 248v/a>        va href="+code=sprintf" class="sref">sprintfv/a>(va href="+code=nami" class="sref">namiv/a>, vspa
 class="string">"%u"v/spa
	, va href="+code=fc" class="sref">fcv/a>->va href="+code=dev" class="sref">devv/a>);4 249v/a>        va href="+code=parent" class="sref">parentv/a> = va href="+code=fuse_ctl_add_dentry" class="sref">fuse_ctl_add_dentryv/a>(va href="+code=parent" class="sref">parentv/a>, va href="+code=fc" class="sref">fcv/a>, va href="+code=nami" class="sref">namiv/a>, va href="+code=S_IFDIR" class="sref">S_IFDIRv/a> | 0500, 2,4 250v/a>                                     &va href="+code=simple_dir_inode_opera12"
s" class="sref">simple_dir_inode_opera12"
sv/a>,4 251v/a>                                     &va href="+code=simple_dir_opera12"
s" class="sref">simple_dir_opera12"
sv/a>);4 252v/a>        if (!va href="+code=parent" class="sref">parentv/a>)4 253v/a>                goto va href="+code=err" class="sref">errv/a>;4 254v/a>4 255v/a>        if (!va href="+code=fuse_ctl_add_dentry" class="sref">fuse_ctl_add_dentryv/a>(va href="+code=parent" class="sref">parentv/a>, va href="+code=fc" class="sref">fcv/a>, vspa
 class="string">"waiting"v/spa
	, va href="+code=S_IFREG" class="sref">S_IFREGv/a> | 0400, 1,4 256v/a>                                 va href="+code=NULL" class="sref">NULLv/a>, &va href="+code=fuse_ctl_waiting_ops" class="sref">fuse_ctl_waiting_opsv/a>) ||4 257v/a>            !va href="+code=fuse_ctl_add_dentry" class="sref">fuse_ctl_add_dentryv/a>(va href="+code=parent" class="sref">parentv/a>, va href="+code=fc" class="sref">fcv/a>, vspa
 class="string">"abort"v/spa
	, va href="+code=S_IFREG" class="sref">S_IFREGv/a> | 0200, 1,4 258v/a>                                 va href="+code=NULL" class="sref">NULLv/a>, &va href="+code=fuse_ctl_abort_ops" class="sref">fuse_ctl_abort_opsv/a>) ||4 259v/a>            !va href="+code=fuse_ctl_add_dentry" class="sref">fuse_ctl_add_dentryv/a>(va href="+code=parent" class="sref">parentv/a>, va href="+code=fc" class="sref">fcv/a>, vspa
 class="string">"max_background"v/spa
	, va href="+code=S_IFREG" class="sref">S_IFREGv/a> | 0600,4 260v/a>                                 1, va href="+code=NULL" class="sref">NULLv/a>, &va href="+code=fuse_conn_max_background_ops" class="sref">fuse_conn_max_background_opsv/a>) ||4 261v/a>            !va href="+code=fuse_ctl_add_dentry" class="sref">fuse_ctl_add_dentryv/a>(va href="+code=parent" class="sref">parentv/a>, va href="+code=fc" class="sref">fcv/a>, vspa
 class="string">"conges12"
_threshold"v/spa
	,4 262v/a>                                 va href="+code=S_IFREG" class="sref">S_IFREGv/a> | 0600, 1, va href="+code=NULL" class="sref">NULLv/a>,4 263v/a>                                 &va href="+code=fuse_conn_conges12"
_threshold_ops" class="sref">fuse_conn_conges12"
_threshold_opsv/a>))4 264v/a>                goto va href="+code=err" class="sref">errv/a>;4 2654.a>4 266v/a>        return 0;4 267v/a>4 268v/a> va href="+code=err" class="sref">errv/a>:4 269v/a>        va href="+code=fuse_ctl_remove_conn" class="sref">fuse_ctl_remove_connv/a>(va href="+code=fc" class="sref">fcv/a>);4 270v/a>        return -va href="+code=ENOMEM" class="sref">ENOMEMv/a>;4 2714.a>}4 2724.a>4 2734.a>vspa
 class="comment">/*v/spa
	4 274v/a>vspa
 class="comment"> * Remove a connec12"
 from the control filesystem (if it exists).v/spa
	4 2754.a>vspa
 class="comment"> * Caller must hold fuse_mutexv/spa
	4 276v/a>vspa
 class="comment"> */v/spa
	4 277v/a>void va href="+code=fuse_ctl_remove_conn" class="sref">fuse_ctl_remove_connv/a>(struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a>)4 278v/a>{4 279v/a>        int va href="+code=i" class="sref">iv/a>;4 280v/a>4 281v/a>        if (!va href="+code=fuse_control_sb" class="sref">fuse_control_sbv/a>)4 282v/a>                return;4 2834.a>4 284v/a>        for (va href="+code=i" class="sref">iv/a> = va href="+code=fc" class="sref">fcv/a>->va href="+code=ctl_ndents" class="sref">ctl_ndentsv/a> - 1; va href="+code=i" class="sref">iv/a> >= 0; va href="+code=i" class="sref">iv/a>--) {4 285v/a>                struct va href="+code=dentry" class="sref">dentryv/a> *va href="+code=dentry" class="sref">dentryv/a> = va href="+code=fc" class="sref">fcv/a>->va href="+code=ctl_dentry" class="sref">ctl_dentryv/a>[va href="+code=i" class="sref">iv/a>];4 286v/a>                va href="+code=dentry" class="sref">dentryv/a>->va href="+code=d_inode" class="sref">d_inodev/a>->va href="+code=i_private" class="sref">i_privatev/a> = va href="+code=NULL" class="sref">NULLv/a>;4 287v/a>                va href="+code=d_drop" class="sref">d_dropv/a>(va href="+code=dentry" class="sref">dentryv/a>);4 288v/a>                va href="+code=dput" class="sref">dputv/a>(va href="+code=dentry" class="sref">dentryv/a>);4 289v/a>        }4 290v/a>        va href="+code=drop_nlink" class="sref">drop_nlinkv/a>(va href="+code=fuse_control_sb" class="sref">fuse_control_sbv/a>->va href="+code=s_root" class="sref">s_rootv/a>->va href="+code=d_inode" class="sref">d_inodev/a>);4 2914.a>}4 2924.a>4 2934.a>static int va href="+code=fuse_ctl_fill_super" class="sref">fuse_ctl_fill_superv/a>(struct va href="+code=super_block" class="sref">super_blockv/a> *va href="+code=sb" class="sref">sbv/a>, void *va href="+code=data" class="sref">datav/a>, int va href="+code=silent" class="sref">silentv/a>)4 294v/a>{4 295v/a>        struct va href="+code=tree_descr" class="sref">tree_descrv/a> va href="+code=empty_descr" class="sref">empty_descrv/a> = {vspa
 class="string">""v/spa
	};4 296v/a>        struct va href="+code=fuse_conn" class="sref">fuse_connv/a> *va href="+code=fc" class="sref">fcv/a>;4 297v/a>        int va href="+code=err" class="sref">errv/a>;4 2ref="+code=d_inode" class="sref">d_d_inode" class="sref">d_d_inode" cla198"> 198v/a>4fuse_use/control.c#L298" idonLLv/a>;4(sss="sref">fuse_contr+code=data" class="sref">ref">fuse_contrfuse/contSUPER_MAGICode=data" classfuse/contSUPER_MAGICbackground_ops" class="sre> = {vspa
 class="string">""v/sL291" class="line" namionL291">3200v/a>  3                        3     3        structv/a>)43201v/a>  3                        3     3        const char *vaf">dentryv/a>;43202v/a>  3                        3     30donL293" class="line" namionL293">3203v/a>  3                        3     30="sref">inodev/a>->va hreL276"_ref="+code=sb" clasL276"_ref=ss="s_threshold_ops" class="srL276"code=fc" class="srefL276" i/sL291" class="line" namionL291">3243v/a>  3  href="fs/fuse/control.3     30ref">fcv/a>->va href="+co"+code=fc" class="sref">fcv/a>->va href="+codl_sbv/a>)43253v/a>  3     struct va href="+co3#L20630="sref">inodev/a> = va href=dl_sbv/a>)4;43263v/a>  3     struct va href="+co3e=den30s="sref">parentv/a> = va hrelist_for_each_="fs/fuse/control.c#list_for_each_="fs//a>);4fuse_colistshold_opsv/a>))4ref">fuse_contr="fs/fuse/control.c#289" idonLL285" class="line" namionL285">3207v/a>  3     struct va href="+co3e=ino30op" class="sref">d_dropv/a>(va href=use/control.c#L298" idonLLv/a>;43208v/a>4<3 href="fs/fuse/control.c3L209"30" class="sref">dputv/v/a>)43298v/a>4<3  href="fs/fuse/cont cla3N" cl30l_add_dentry" cla="sref">d_dropv/a>(va href=dl_sbv/a>)4;43210v/a>  3     va href="+code=dent3y" cl31 va href="+code=NULL" class="v/a>->va hreL276"_unref="+code=sb" clasL276"_unref=ss="s_threshold_ops" class="srL276"code=fc" class="srefL276" i/sL291" class="line" namionL291">3211v/a>  3     if (!va href="+code3dentr31  &va href="+code=simple_f">dentryv/a>;43212v/a>  3             return va h3ef="+3ode=NULL" class="sref"292" class="line" namionL292">32134.a>4<3 href="fs/fuse/control.c3L214"31="sref">inode292" class="line" namionL292">3243v/a>  3     va href="+code=fc" 3lass=3sref">fcv/a>->va href="+coL276"_unref="+code=sb" clasL276"_unref=ss="s_threshold_ops" class="srL276"code=fc" class="srefL276" i/sL291" class="line" namionL291">3253v/a>  3     va href="+code=inod3" cla31donL266" class="line" namionL266">3216v/a>  3     if (!va href="+code3inode31control.c#L267" idonL267" class="line" namionL267">3217v/a>  3             return va h3ef="+3ode=NU292" class="line" namionL292">3208v/a>4<3 href="fs/fuse/control.c3L219"3idonL219" class="line" namionL219">3219v/a>  3     va href="+code=inod3" cla31" class="sref">dentryv/a> *va href="+code=fuse_ctl_add_dentry" class="sref">fuse_ctl_add_demcode=ppos" class="stl_add_demcodeass="sref">fuse_connv/a> *vaclass/fuse_typs/fuse/control.caclass/fuse_typs" class="sref">fuse_cts_typs/fuse/control.cas_typs" cl263" class="line" namionL263">3220v/a>  3     va href="+code=inod3" cla32 va href="+code=NULL" class="class="sref">fuse_ctlageshold_opsv/a>))4lagesref">cref">namiv/a>,4datav/a>, int va hrefraw_="+code=silent" claraw_="+cdonL294" class="line" namionL294">3221v/a>  3     va href="+code=inod3" cla3s="sre285" class="line" namionL285">3222v/a>  3     va href="+code=inod3" cla3s="sref">inodef">dentryv/a>;4fuse_ctlageshold_opsv/a>))4lagesref">a>, int va hrefraw_="+code=silent" claraw_="+cdonL2ss="sref">fuse_ctl_fill_superv/a>(struct va href="+code=super_block" clasL291" class="line" namionL291">3223v/a>  3     va href="+code=inod3" cla3s="sre292" class="line" namionL292">3224v/a>  3     vspa
 class="commen3">/* 32donL255" class="line" namionL255">3225v/a>  3     if (va href="+code=3op" c32file_opera12" class="sref">fuse_ctl_removkr_blohref="fs/fuse/control.movkr_blohclass="sref">super_blockv/a> *va href="+code=sb" class="sref">sbv/a>, void *va href="+code=data" class="sref294" class="line" namionL294">3216v/a>  3             va href="+c3de=in32idonL157" class="line" namionL157">3227v/a>  3     va href="+code=inod3" cla32" class="sref">inodev/a> *va href="a href="+code=fc" class="sref">fcv/a>;43228v/a>  3     va href="+code=set_3link"32donL219" class="line" namionL219">3229v/a>  3     va href="+code=inod3" cla3s="sref">inodev/a>->va hreL276"_ref="+code=sb" clasL276"_ref=ss="s_threshold_ops" class="srL276"code=fc" class="srefL276" i/sL291" class="line" namionL291">3230v/a>  3     va href="+code=d_ad3" cla3s="sref">d_addv/a>(va href="+dl_sbv/a>)4;43231v/a>  3     return va href="+co3e=den33="sref">inodev/a>->va hrelist_for_each_="fs/fuse/control.c#list_for_each_="fs//a>);4fuse_colistshold_opsv/a>))4ref">fuse_contr="fs/fuse/control.c#289" idonL87" class="line" namionL287">3222v/a>  3a href="fs/fuse/control.3#L23333de=NULL" class="sref"gt;va href="+code=ctl_dentry" class="sref">ctl_dentryv/a>[va h va href="+code=i" class="sref">iv/a=nL267" class="line" namionL267">32334.a>4<3 href="fs/fuse/control.c3L234"33="sref">inodev/a>->va hreL276"_unref="+code=sb" clasL276"_unref=ss="s_threshold_ops" class="srL276"code=fc" class="srefL276" i/sL291" class="line" namionL291">3234v/a>vs3a
 class="comment">/*v/s3a
	4<33donL255" class="line" namionL255">32354.a>vs3a
 class="comment"> * Ad3 a co33="sref">inodev/a> = va href=kr_bllittsre/a>(struct va href="kr_bllittsre/a>(sss="sref">fuse_contr+code=data" class="srefL291" class="line" namionL291">3216v/a>  3a
 class="comment"> * mu3t hol3 fuse_292" class="line" namionL292">3237v/a>vs3a
 class="comment"> */v/3pa
	433donL268" class="line" namionL268">3238v/a>in3 va href="+code=fuse_ctl3add_c3nn" clss="sref">dentryv/a> *va hrefaclass/fuse_typs/fuse/control.caclass/fuse_typs" clas="sref">fuse_ctl_fill_sus_typs/fuse/control.cal_fill_sus_typs;v/spa
	68" class="line" namionL268">3229v/a>  3a href="fs/fuse/control.3#L24033ss="sref">llseekv/a> = va hreown(struct va href="own(se=NULL" class=v/a>;43240v/a>  3     struct va href="+co3e=den34="sref">openv/a> = va href="+ode=S_IFDIR" class="sref">S LL" class=v/a;43241v/a>  3     char va href="+code3nami"34="sref">readv/a> = va href="+mcode=ppos" class="smcodeass=LL" class=v/a>;43222v/a>  3 href="fs/fuse/control.c3L243"34ss="sref">llseekv/a> = va hrekr_blohref="fs/fuse/cokr_blohclas" class=v/a>;432334.a>4<3     if (!va href="+code3fuse_34 idonL184" class="line" namionL184">3244v/a>  3             return 0;4<3 href34donL255" class="line" namionL255">32454.a>4<3 href="fs/fuse/control.c3L246"3idonL2class="sref">fuse_c__inie=ppos" class="s__inie" clas="sref">fuse_ctl_fill_sinie=ppos" class="stl_fill_siniess="s" clL87" class="line" namionL287">3246v/a>  3     va href="+code=pare3t" cl34idonL157" class="line" namionL157">3247v/a>  3     va href="+code=inc_3link"3class="sref">iretv/a>;43248v/a>  3     va href="+code=spri3tf" c3ass="s292" class="line" namionL292">3249v/a>  3     va href="+code=pare3t" cl34donL170" class="line" namionL170">3250v/a>  3                        3     3   &am" class="sref">fuse_ctl_removcleanue/control.c#L228"tl_removcleanuess="s" clL87" class="line" namionL287">3251v/a>  3                        3     35="sre285" class="line" namionL285">3252v/a>  3     if (!va href="+code3paren3" class="sref"ss="sref">fuse_unusgistsref="fs/fuseode=silent" claunusgistsref="fs/fusess="s_threshold_ops" class="srll_sus_typs/fuse/control.cal_fill_sus_typs;v/sL291" class="line" namionL291">3253v/a>  3             goto va hre3="+co35="sre292" class="line" namionL292">3254v/a>4<3 href="fs/fuse/control.c3L255"3idonL2


The original LXR software by/spa 2" class=http://sourceforge.net/proj lls/lxr">LXR trolunie">inodethis ex>(sil.c#al versxistby/2" class=mailto:lxr@useux.noc#lxr@useux.no>ino. lxr.useux.no kindly hofusdtby/2" class=http://www.redpr_b-usepro.noc#Redpr_b Lsepro AS>inodeprovider of Lseux>crefulv/spaand l.c#L252" service sincetry"5.