linux/fs/fscache/fsdef.c
<<
on v.6./spa> .6./form .6.a on v.6 href="../linux+v3v2.7/fs/fscache/fsdef.c">on v.6.img src="../.static/gfx/right.png" alt=">>">on./spa> on.spa> class="lxr_search">on v="+search" method="post" onsubmit="return do_search(this);">on v.6.input typon>hidden" namon>navtarget" option>">on v.6.input typon>text" namon>search" idn>search">on v.6.butt6submit">Search on.spa> class="lxr_prefs" .6.a href="+prefs?return=fs/fscache/fsdef.c"on v.6 onclick="return ajax_prefs();">on v.6Prefs .6./a>on./spa> v.6 6./div v.6 6.form ac >="ajax+*" method="post" onsubmit="return false;">on.input typon>hidden" namon>ajax_lookup" idn>ajax_lookup" option>">o v.6 6./form o v.6 6.div class="headingbott6m">
search_results" class="search_results" . v.6 6./div .div idn>content"> .div idn>file_contents"
57/6e/efdccf4d9b4106b8cd5cdf57ae842ae0f014_3/0"
L1" class="line" namon>L1">6 61./a>.spa> class="comment">/* Filesystem index defini	  >./spa>
 L2" class="line" namon>L2">6 62./a>.spa> class="comment"> *./spa>
 L3" class="line" namon>L3">6 63./a>.spa> class="comment"> * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved../spa>
 L4" class="line" namon>L4">6 64./a>.spa> class="comment"> * Written by David Howells (dhowells@redhat.com)./spa>
 L5" class="line" namon>L5">6 65./a>.spa> class="comment"> *./spa>
 L6" class="line" namon>L6">6 66./a>.spa> class="comment"> * This program is free software; you ca> redistribute it and/or./spa>
 L7" class="line" namon>L7">6 67./a>.spa> class="comment"> * modify it under the terms of the GNU General Public License./spa>
 L8" class="line" namon>L8">6 68./a>.spa> class="comment"> * as published by the Free Software Founda	  >; either vers  >./spa>
 L9" class="line" namon>L9">6 69./a>.spa> class="comment"> * 2 of the License, or (at your "
	  >) any later vers  >../spa>
 L10" class="line" namon>L10">6 1 ona>.spa> class="comment"> */./spa>
 L11" class="line" namon>L11">6 11./a> L12" class="line" namon>L12">6 12./a>#define6.a href="+code=FSCACHE_DEBUG_LEVEL" class="sref">FSCACHE_DEBUG_LEVEL./a>6.a href="+code=CACHE" class="sref">CACHE./a> L13" class="line" namon>L13">6 13./a>#include <linux/module.h./a>> L14" class="line" namon>L14">6 14./a>#include "internal.h./a>" L15" class="line" namon>L15">6 15./a> L16" class="line" namon>L16">6 16./a>static6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=fscache_fsdef_netfs_get_key" class="sref">fscache_fsdef_netfs_get_key./a>(const void *.a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>, L17" class="line" namon>L17">6 17./a>                                            void *.a href="+code=buffer" class="sref">buffer./a>,6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=bufmax" class="sref">bufmax./a>); L18" class="line" namon>L18">6 18./a> L19" class="line" namon>L19">6 19./a>static6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=fscache_fsdef_netfs_get_aux" class="sref">fscache_fsdef_netfs_get_aux./a>(const void *.a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>, L20" class="line" namon>L20">6 20./a>                                            void *.a href="+code=buffer" class="sref">buffer./a>,6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=bufmax" class="sref">bufmax./a>); L21" class="line" namon>L21">6 21./a> L22" class="line" namon>L22">6 22./a>static L23" class="line" namon>L23">6 23./a>enum6.a href="+code=fscache_checkaux" class="sref">fscache_checkaux./a>6.a href="+code=fscache_fsdef_netfs_check_aux" class="sref">fscache_fsdef_netfs_check_aux./a>(void *.a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>, L24" class="line" namon>L24">6 24./a>                                                    const void *.a href="+code=da	a" class="sref">da	a./a>, L25" class="line" namon>L25">6 25./a>                                                    .a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=da	alen" class="sref">da	alen./a>); L26" class="line" namon>L26">6 26./a> L27" class="line" namon>L27">6 27./a>.spa> class="comment">/*./spa>
 L28" class="line" namon>L28">6 28./a>.spa> class="comment"> * The root index is owned by FS-Cache itself../spa>
 L29" class="line" namon>L29">6 29./a>.spa> class="comment"> *./spa>
 L30" class="line" namon>L30">6 3 ona>.spa> class="comment"> * When a netfs requests caching facilities, FS-Cache will, if one6doesn't./spa>
 L31" class="line" namon>L31">6 31./a>.spa> class="comment"> * already exist, create an entry in the root index with the key being the namo./spa>
 L32" class="line" namon>L32">6 32./a>.spa> class="comment"> * of the netfs ("AFS" for example), and the auxiliary da	a holding the index./spa>
 L33" class="line" namon>L33">6 33./a>.spa> class="comment"> * structure vers  > supplied by the netfs:./spa>
 L34" class="line" namon>L34">6 34./a>.spa> class="comment"> *./spa>
 L35" class="line" namon>L35">6 35./a>.spa> class="comment"> *                                   FSDEF./spa>
 L36" class="line" namon>L36">6 36./a>.spa> class="comment"> *                                     |./spa>
 L37" class="line" namon>L37">6 37./a>.spa> class="comment"> *                               +-----------+./spa>
 L38" class="line" namon>L38">6 38./a>.spa> class="comment"> *                               |           |./spa>
 L39" class="line" namon>L39">6 39./a>.spa> class="comment"> *                              NFS         AFS./spa>
 L40" class="line" namon>L40">6 4 ona>.spa> class="comment"> *                             [v=1]       [v=1]./spa>
 L41" class="line" namon>L41">6 41./a>.spa> class="comment"> *./spa>
 L42" class="line" namon>L42">6 42./a>.spa> class="comment"> * If an entry with the appropriate namo6does already exist, the vers  > is./spa>
 L43" class="line" namon>L43">6 43./a>.spa> class="comment"> * compared.  If the vers  > is different, the entire subtree from that entry./spa>
 L44" class="line" namon>L44">6 44./a>.spa> class="comment"> * will be discarded and a new entry created../spa>
 L45" class="line" namon>L45">6 45./a>.spa> class="comment"> *./spa>
 L46" class="line" namon>L46">6 46./a>.spa> class="comment"> * The new entry will be a> index, and a cookie referring to it will be passed./spa>
 L47" class="line" namon>L47">6 47./a>.spa> class="comment"> * to the netfs.  This is then the root handle by which the netfs accesses the./spa>
 L48" class="line" namon>L48">6 48./a>.spa> class="comment"> * cache.  It ca> create whatever objects it likes in that index, including./spa>
 L49" class="line" namon>L49">6 49./a>.spa> class="comment"> * further indices../spa>
 L50" class="line" namon>L50">6 5 ona>.spa> class="comment"> */./spa>
 L51" class="line" namon>L51">6 51./a>static6struct6.a href="+code=fscache_cookie_def" class="sref">fscache_cookie_def./a>6.a href="+code=fscache_fsdef_index_def" class="sref">fscache_fsdef_index_def./a>6= { L52" class="line" namon>L52">6 52./a>        ..a href="+code=namo" class="sref">namo./a>           = .spa> class="string">".FS-Cache"
, L53" class="line" namon>L53">6 53./a>        ..a href="+code=typo" class="sref">typo./a>           = .a href="+code=FSCACHE_COOKIE_TYPE_INDEX" class="sref">FSCACHE_COOKIE_TYPE_INDEX./a>, L54" class="line" namon>L54">6 54./a>}; L55" class="line" namon>L55">6 55./a> L56" class="line" namon>L56">6 56./a>struct6.a href="+code=fscache_cookie" class="sref">fscache_cookie./a>6.a href="+code=fscache_fsdef_index" class="sref">fscache_fsdef_index./a>6= { L57" class="line" namon>L57">6 57./a>        ..a href="+code=usage" class="sref">usage./a>          = .a href="+code=ATOMIC_INIT" class="sref">ATOMIC_INIT./a>(1), L58" class="line" namon>L58">6 58./a>        ..a href="+code=lock" class="sref">lock./a>           = .a href="+code=__SPIN_LOCK_UNLOCKED" class="sref">__SPIN_LOCK_UNLOCKED./a>(.a href="+code=fscache_fsdef_index" class="sref">fscache_fsdef_index./a>..a href="+code=lock" class="sref">lock./a>), L59" class="line" namon>L59">6 59./a>        ..a href="+code=backing_objects" class="sref">backing_objects./a>6= .a href="+code=HLIST_HEAD_INIT" class="sref">HLIST_HEAD_INIT./a>, L60" class="line" namon>L60">6 60./a>        ..a href="+code=def" class="sref">def./a>6           = &.a href="+code=fscache_fsdef_index_def" class="sref">fscache_fsdef_index_def./a>, L61" class="line" namon>L61">6 61./a>}; L62" class="line" namon>L62">6 62./a>.a href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL./a>(.a href="+code=fscache_fsdef_index" class="sref">fscache_fsdef_index./a>); L63" class="line" namon>L63">6 63./a> L64" class="line" namon>L64">6 64./a>.spa> class="comment">/*./spa>
 L65" class="line" namon>L65">6 65./a>.spa> class="comment"> * Defini	  > of an entry in the root index.  Each entry is a> index, keyed to./spa>
 L66" class="line" namon>L66">6 66./a>.spa> class="comment"> * a specific6netfs and only applicable to a particular vers  > of the index./spa>
 L67" class="line" namon>L67">6 67./a>.spa> class="comment"> * structure used by that netfs../spa>
 L68" class="line" namon>L68">6 68./a>.spa> class="comment"> */./spa>
 L69" class="line" namon>L69">6 69./a>struct6.a href="+code=fscache_cookie_def" class="sref">fscache_cookie_def./a>6.a href="+code=fscache_fsdef_netfs_def" class="sref">fscache_fsdef_netfs_def./a>6= { L70" class="line" namon>L70">6 70./a>        ..a href="+code=namo" class="sref">namo./a>           = .spa> class="string">"FSDEF.netfs"
, L71" class="line" namon>L71">6 71./a>        ..a href="+code=typo" class="sref">typo./a>           = .a href="+code=FSCACHE_COOKIE_TYPE_INDEX" class="sref">FSCACHE_COOKIE_TYPE_INDEX./a>, L72" class="line" namon>L72">6 72./a>        ..a href="+code=get_key" class="sref">get_key./a>        = .a href="+code=fscache_fsdef_netfs_get_key" class="sref">fscache_fsdef_netfs_get_key./a>, L73" class="line" namon>L73">6 73./a>        ..a href="+code=get_aux" class="sref">get_aux./a>        = .a href="+code=fscache_fsdef_netfs_get_aux" class="sref">fscache_fsdef_netfs_get_aux./a>, L74" class="line" namon>L74">6 74./a>        ..a href="+code=check_aux" class="sref">check_aux./a>      = .a href="+code=fscache_fsdef_netfs_check_aux" class="sref">fscache_fsdef_netfs_check_aux./a>, L75" class="line" namon>L75">6 75./a>}; L76" class="line" namon>L76">6 76./a> L77" class="line" namon>L77">6 77./a>.spa> class="comment">/*./spa>
 L78" class="line" namon>L78">6 78./a>.spa> class="comment"> * get the key da	a for a> FSDEF index record - this is the namo6of the netfs./spa>
 L79" class="line" namon>L79">6 79./a>.spa> class="comment"> * for which this entry is created./spa>
 L80" class="line" namon>L80">6 8 ona>.spa> class="comment"> */./spa>
 L81" class="line" namon>L81">6 81./a>static6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=fscache_fsdef_netfs_get_key" class="sref">fscache_fsdef_netfs_get_key./a>(const void *.a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>, L82" class="line" namon>L82">6 82./a>                                            void *.a href="+code=buffer" class="sref">buffer./a>,6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=bufmax" class="sref">bufmax./a>) L83" class="line" namon>L83">6 83./a>{ L84" class="line" namon>L84">6 84./a>        const struct6.a href="+code=fscache_netfs" class="sref">fscache_netfs./a> *.a href="+code=netfs" class="sref">netfs./a> = .a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>; L85" class="line" namon>L85">6 85./a>        unsigned .a href="+code=klen" class="sref">klen./a>; L86" class="line" namon>L86">6 86./a> L87" class="line" namon>L87">6 87./a>        .a href="+code=_enter" class="sref">_enter./a>(.spa> class="string">"{%s.%u},"
, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=namo" class="sref">namo./a>, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=vers  >" class="sref">vers  >./a>); L88" class="line" namon>L88">6 88./a> L89" class="line" namon>L89">6 89./a>        .a href="+code=klen" class="sref">klen./a> = .a href="+code=strlen" class="sref">strlen./a>(.a href="+code=netfs" class="sref">netfs./a>->.a href="+code=namo" class="sref">namo./a>); L90" class="line" namon>L90">6 90./a>        if (.a href="+code=klen" class="sref">klen./a> >6.a href="+code=bufmax" class="sref">bufmax./a>) L91" class="line" namon>L91">6 91./a>                return 0; L92" class="line" namon>L92">6 92./a> L93" class="line" namon>L93">6 93./a>        .a href="+code=memcpy" class="sref">memcpy./a>(.a href="+code=buffer" class="sref">buffer./a>,6.a href="+code=netfs" class="sref">netfs./a>->.a href="+code=namo" class="sref">namo./a>, .a href="+code=klen" class="sref">klen./a>); L94" class="line" namon>L94">6 94./a>        return .a href="+code=klen" class="sref">klen./a>; L95" class="line" namon>L95">6 95./a>} L96" class="line" namon>L96">6 96./a> L97" class="line" namon>L97">6 97./a>.spa> class="comment">/*./spa>
 L98" class="line" namon>L98">6 98./a>.spa> class="comment"> * get the auxiliary da	a for a> FSDEF index record - this is the index./spa>
 L99" class="line" namon>L99">6 99./a>.spa> class="comment"> * structure vers  > number of the netfs for which this vers  > is created./spa>
 L100" class="line" namon>L100">6100ona>.spa> class="comment"> */./spa>
 L101" class="line" namon>L101">6101./a>static6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=fscache_fsdef_netfs_get_aux" class="sref">fscache_fsdef_netfs_get_aux./a>(const void *.a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>, L102" class="line" namon>L102">6102./a>                                            void *.a href="+code=buffer" class="sref">buffer./a>,6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=bufmax" class="sref">bufmax./a>) L103" class="line" namon>L103">6103./a>{ L104" class="line" namon>L104">6104./a>        const struct6.a href="+code=fscache_netfs" class="sref">fscache_netfs./a> *.a href="+code=netfs" class="sref">netfs./a> = .a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>; L105" class="line" namon>L105">6105./a>        unsigned .a href="+code=dlen" class="sref">dlen./a>; L106" class="line" namon>L106">6106./a> L107" class="line" namon>L107">6107./a>        .a href="+code=_enter" class="sref">_enter./a>(.spa> class="string">"{%s.%u},"
, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=namo" class="sref">namo./a>, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=vers  >" class="sref">vers  >./a>); L108" class="line" namon>L108">6108./a> L109" class="line" namon>L109">6109./a>        .a href="+code=dlen" class="sref">dlen./a> = sizeof(.a href="+code=uint32_t" class="sref">uint32_t./a>);t" onsubmie License, or (at your "
" idn1190" class="line" namon>L90">6 906109./a>        .a href="+code=klen" class="sref">klen./a> >6.a href="+code=bufmax" class="sref">bufmax./a>1
 L1191" class="line" namon>L91">6 91./a>                return 01> L92">6 92./a1> L93">6 93./a>        .a href="+code=memcpy" class="sref">memcpy./a>(.a href="+code=buss="sref">def./a>6  sref">namo./a>, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=veode=namo" class="6109./a>        .a href="+c32_t" class="sref">uint32_t./a>);tL94">6 94./a       unsigned .a href="+code=dlen" class="sref">dlen./a>;; L95">6 95./a>1> L106">6106./a>, L97">6 97./a>.spa> class="comment">/*./spa>1; L48">6 4ss="="comm> FSDEF i 99./a>.spa> class="commenstoron>ent"> *pa> class="com 97./a>.spa> class="comment">/*./spa>1;L99">6 matent a> FS fac * structugavpa>  97./a>.spa> class="comment">/*./spa>1, L100">6100ona>.spa> class="comment"> */./spa>
; L23">6 23./a>enum6.a href="+code=fscache_checkaux" class="sref">fscache_checkaux./a>6.a href="+code=fscache_fsdef_netfs_check_aux" class="sref">fscspa> class="comment"> */./spa>
; cookie_netfs_da	a./a>,c da	a./a>1, buffer./a>,6.a href="+code=uint16_t" class="sref">uint16_t./a>6.a href="+code=da	de=da	a" class="sref">da	a./a>1, L103">6103./a>{; 6104./a>        const struct6.a href="+code=fscache_netfs" class="sref">fscache_netfs./a> *.a href="+code=netfs" class="sref">netfs./a> = .a href="+code=cookie_netfs_da	a" class="sref">cookie_netfs_da	a./a>;> L107">en./a> = sizeof(.a href="+code=uintne" namon>L107">">netfs./a>->.a href="+code=vess="sref">cookie_netfs_da	a./a>;>">netfs./lass="srs./a>6= .a href1>">netfs./lass="srs./a>6= .a href1>">ne8./a>
 L109">6107./a>        .a href="+code=_enter" class="sref">_enter./a>(.s},,/a>(.hu="string">"{%s.%u},"
, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=namo" class=ef">uint16_t./a>6.a href="+code=da	alen" class="sref">da	alen./a>1>
 L30" alen" class="sref">da	alen./a>1>; L90">6 90f">uint16_t./a>6.a href="+code=d !ode=dlen" class="sref">df">netfs./a>->.a href="+code=ve)f">fscache_fsdef_netfs_def./a>6=1>
 L109">legav/a>        .a hrlegavcode=_enter" class="sref">_enterde=OBSOLETE [dl=/a>(.d v=/a>(.zu]="string">"{%s.%u0f">uint16_t./a>6.a href="+code=d,de=dlen" class="sref">df">netfs./a>->.a href="+code=ve)	alen" class="sref">da	alen./a>1>> L94">6 94./COOKIE_TYHECKAUX_OBSOLETEs./a>->.a hrCOOKIE_TYHECKAUX_OBSOLETEde=vess="sref">cookie_netfs_da	a./a>>
 L95">6 95./a>>
 L15">6 15./a>
 L109">6 93./a>        .a href="+code=uss="sref">def./a>6 f">netfs./a>->.a href="+code=veode=namo" class="    const void *.a href="+cde=dlen" class="sref">df">netfs./a>->.a href="+code=ve)	alen" class="sref">da	alen./a>1>> L90">6 9f">netfs./a>->.a href="+code=v !odde=namo" class="sref">namo./a>, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=vef">fscache_fsdef_netfs_def./a>6=1>>">netfs.f="fs/fscache/fsdef.c#L318" id1382" class="line" namone" namon>L109">legav/a>        .a hrlegavcode=_enter" class="sref">_enterde=OBSOLETE [ef==/a>(.x str=/a>(.x]="string">"{%s.%uf">netfs./a>->.a href="+code=veode=namo" class="sref">namo./a>, .a href="+code=netfs" class="sref">netfs./a>->.a href="+code=vers  >" class="sref">vers  >./a>)>
 L94">6 94./COOKIE_TYHECKAUX_OBSOLETEs./a>->.a hrCOOKIE_TYHECKAUX_OBSOLETEde=vess="sref">cookie_netfs_da	a./a>>
 L95">6 95./a>>
 L11">6 11./a>
 L109">legav/a>        .a hrlegavcode=_enter" class="sref">_enterde=OKAY="string">&quers  >" class="sref">vers  >./a>)>
 L94">6 94./COOKIE_TYHECKAUX_OKAYs./a>->.a hrCOOKIE_TYHECKAUX_OKAYde=vess="sref">cookie_netfs_da	a./a>>; L44" class="line" namon>L95">6 95./a>>
 L45" c/pre v.6 6.d

lass="search_s/fscacfoo07./>
 46.original LXRcomment">t"> * stass="linehttp://sourceforge.spa/proobjec/lx./>LXRcamonunitsref">pa> claxperin>L1al a> class"> ass="linemailto:lx.@le/li.no">lx.@le/li.noref".
lass="sarch_s/fscacsubfoo07./>
lx..le/li.no kindly host classass="linehttp://www.redpill-le/pro.no">Redpill Le/pro ASref">pprovidmment"Le/lili   ultbe as="coperisheds 2007> clde=nce 1995.
lass="sea/body"sa/html.d