linux/include/linux/fscache.h
<<
2alu92alu92a//spa3.12a/spa3 class="lxr_search">2alu2alu92alu92alu9Search2alu92a//spa3.1lu9< 2a/input typi.1hidden" nami.1ajax_lookup" id.1ajax_lookup" aloti.1">2lu9< 1 /div id.1file_contents".
< <1//a>/spa3 class="comment">/* General filesystem caching interface//spa3.1< <2//a>/spa3 class="comment"> *//spa3.1< <3//a>/spa3 class="comment"> * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved.//spa3.1< <4//a>/spa3 class="comment"> * Written by David Howells (dhowells@redhat.com)//spa3.1< <5//a>/spa3 class="comment"> *//spa3.1< <6//a>/spa3 class="comment"> * This program is free software; you can redistribute it and/or//spa3.1< <7//a>/spa3 class="comment"> * modify it under the terms of the GNU General Public License//spa3.1< <8//a>/spa3 class="comment"> * as published by the Free Software Founda  v3; either vers v3//spa3.1< <9//a>/spa3 class="comment"> * 2 of the License, or (at your >
  v3) any later vers v3.//spa3.1< e="va>/spa3 class="comment"> *//spa3.1< 11//a>/spa3 class="comment"> * NOTE!!! See://spa3.1< 12//a>/spa3 class="comment"> *//spa3.1< 13//a>/spa3 class="comment"> *      Documenta  v3/filesystems/caching/netfs-api.txt//spa3.1< 14//a>/spa3 class="comment"> *//spa3.1< 15//a>/spa3 class="comment"> * for a descri2< 16//a>/spa3 class="comment"> *///spa3.1< 17//a>1< 18//a>#ifndef_LINUX_FSCACHE_H//a>1< 19//a>#define_LINUX_FSCACHE_H//a>1< 20//a>1< 21//a>#include <linux/fs.h//a>>1< 22//a>#include <linux/list.h//a>>1< 23//a>#include <linux/pagemap.h//a>>1< 24//a>#include <linux/pagevec.h//a>>1< 25//a>1< 26//a>#ifdefined//a>(/a href="+code=CONFIG_FSCACHE" class="sref">CONFIG_FSCACHE//a>) ||defined//a>(/a href="+code=CONFIG_FSCACHE_MODULE" class="sref">CONFIG_FSCACHE_MODULE//a>)1< 27//a>#definefscache_available//a>() (1)1< 28//a>#definefscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>) (/a href="+code=cookie" class="sref">cookie//a>)1< 29//a>#else1< 30//a>#definefscache_available//a>() (0)1< 31//a>#definefscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>) (0)1< 32//a>#endif1< 33//a>1< 34//a>1< 35//a>/spa3 class="comment">/*//spa3.1< 36//a>/spa3 class="comment"> * overload PG_private_2 to give us PG_fscache - this is used to indicate that//spa3.1< 37//a>/spa3 class="comment"> * a page is currently backed by a local disk cache//spa3.1< 38//a>/spa3 class="comment"> *///spa3.1< 39//a>#definePageFsCache//a>(/a href="+code=page" class="sref">page//a>)               /a href="+code=PagePrivate2" class="sref">PagePrivate2//a>((/a href="+code=page" class="sref">page//a>))1< 40//a>#defineSetPageFsCache//a>(/a href="+code=page" class="sref">page//a>)            /a href="+code=SetPagePrivate2" class="sref">SetPagePrivate2//a>((/a href="+code=page" class="sref">page//a>))1< 41//a>#defineClearPageFsCache//a>(/a href="+code=page" class="sref">page//a>)          /a href="+code=ClearPagePrivate2" class="sref">ClearPagePrivate2//a>((/a href="+code=page" class="sref">page//a>))1< 42//a>#defineTestSetPageFsCache//a>(/a href="+code=page" class="sref">page//a>)        /a href="+code=TestSetPagePrivate2" class="sref">TestSetPagePrivate2//a>((/a href="+code=page" class="sref">page//a>))1< 43//a>#defineTestClearPageFsCache//a>(/a href="+code=page" class="sref">page//a>)      /a href="+code=TestClearPagePrivate2" class="sref">TestClearPagePrivate2//a>((/a href="+code=page" class="sref">page//a>))1< 44//a>1< 45//a>/spa3 class="comment">/* pattern used to fill dead space in a3 index entry *///spa3.1< 46//a>#defineFSCACHE_INDEX_DEADFILL_PATTERN//a> 0x791< 47//a>1< 48//a>structpagevec//a>;1< 49//a>structfscache_cache_tag//a>;1< 50//a>structfscache_cookie//a>;1< 51//a>structfscache_netfs//a>;1< 52//a>1< 53//a>typideffscache_rw_complete_t//a>)(structpage//a> */a href="+code=page" class="sref">page//a>,1< 54//a>                                      void */a href="+code=context" class="sref">context//a>,1< 55//a>                                      interror//a>);1< 56//a>1< 57//a>/spa3 class="comment">/* result2of index entry consulta  v3 *///spa3.1< 58//a>enumfscache_checkaux//a> {1< 59//a>        /a href="+code=FSCACHE_CHECKAUX_OKAY" class="sref">FSCACHE_CHECKAUX_OKAY//a>,          /spa3 class="comment">/* entry okay as is *///spa3.1< 60//a>        /a href="+code=FSCACHE_CHECKAUX_NEEDS_UPDATE" class="sref">FSCACHE_CHECKAUX_NEEDS_UPDATE//a>,  /spa3 class="comment">/* entry requires update *///spa3.1< 61//a>        /a href="+code=FSCACHE_CHECKAUX_OBSOLETE" class="sref">FSCACHE_CHECKAUX_OBSOLETE//a>,      /spa3 class="comment">/* entry requires delet v3 *///spa3.1< 62//a>};1< 63//a>1< 64//a>/spa3 class="comment">/*//spa3.1< 65//a>/spa3 class="comment"> * fscache cookie definit v3//spa3.1< 66//a>/spa3 class="comment"> *///spa3.1< 67//a>structfscache_cookie_def//a> {1< 68//a>        /spa3 class="comment">/* nami2of cookie typi *///spa3.1< 69//a>        charnami//a>[16];1< 70//a>1< 71//a>        /spa3 class="comment">/* cookie typi *///spa3.1< 72//a>        /a href="+code=uint8_t" class="sref">uint8_t//a> /a href="+code=typi" class="sref">typi//a>;1< 73//a>#defineFSCACHE_COOKIE_TYPE_INDEX//a>       01< 74//a>#defineFSCACHE_COOKIE_TYPE_DATAFILE//a>    11< 75//a>1< 76//a>        /spa3 class="comment">/* select the cache into which to insert an entry in this index//spa3.1< 77//a>/spa3 class="comment">         * - >
  v3al//spa3.1< 78//a>/spa3 class="comment">         * - should return a cache identifier or NULL to cause the cache to be//spa3.1< 79//a>/spa3 class="comment">         *   inherited from the parent if possible or the first cache picked//spa3.1< 8="va>/spa3 class="comment">         *   for a non-index file if not//spa3.1< 81//a>/spa3 class="comment">         *///spa3.1< 82//a>        structfscache_cache_tag//a> *(*/a href="+code=select_cache" class="sref">select_cache//a>)(1< 83//a>                const void */a href="+code=parent_netfs_data" class="sref">parent_netfs_data//a>,1< 84//a>                const void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>);1< 85//a>1< 86//a>        /spa3 class="comment">/* get a3 index key//spa3.1< 87//a>/spa3 class="comment">         * - should store the key data in the buffer//spa3.1< 88//a>/spa3 class="comment">         * - should return the amount2of data stored//spa3.1< 89//a>/spa3 class="comment">         * - not permitted to return an error//spa3.1< 9="va>/spa3 class="comment">         * - the netfs data from the cookie being used as the source is//spa3.1< 91//a>/spa3 class="comment">         *   presented//spa3.1< 92//a>/spa3 class="comment">         *///spa3.1< 93//a>        /a href="+code=uint16_t" class="sref">uint16_t//a> (*/a href="+code=get_key" class="sref">get_key//a>)(const void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>,1< 94//a>                            void */a href="+code=buffer" class="sref">buffer//a>,1< 95//a>                            /a href="+code=uint16_t" class="sref">uint16_t//a> /a href="+code=bufmax" class="sref">bufmax//a>);1< 96//a>1< 97//a>        /spa3 class="comment">/* get certain file attributes from the netfs data//spa3.1< 98//a>/spa3 class="comment">         * - this func  v3 can be absent for an index//spa3.1< 99//a>/spa3 class="comment">         * - not permitted to return an error//spa3.1<100"va>/spa3 class="comment">         * - the netfs data from the cookie being used as the source is//spa3.1<101//a>/spa3 class="comment">         *   presented//spa3.1<102//a>/spa3 class="comment">         *///spa3.1<103//a>        void (*/a href="+code=get_attr" class="sref">get_attr//a>)(const void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>, /a href="+code=uint64_t" class="sref">uint64_t//a> */a href="+code=size" class="sref">size//a>);1<104//a>1<105//a>        /spa3 class="comment">/* get the auxiliary data from netfs data//spa3.1<106//a>/spa3 class="comment">         * - this func  v3 can be absent if the index carries no state data//spa3.1<107//a>/spa3 class="comment">         * - should store the auxiliary data in the buffer//spa3.1<108//a>/spa3 class="comment">         * - should return the amount2of amount2stored//spa3.1<109//a>/spa3 class="comment">         * - not permitted to return an error//spa3.1<1e="va>/spa3 class="comment">         * - the netfs data from the cookie being used as the source is//spa3.1<111//a>/spa3 class="comment">         *   presented//spa3.1<112//a>/spa3 class="comment">         *///spa3.1<113//a>        /a href="+code=uint16_t" class="sref">uint16_t//a> (*/a href="+code=get_aux" class="sref">get_aux//a>)(const void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>,1<114//a>                            void */a href="+code=buffer" class="sref">buffer//a>,1<115//a>                            /a href="+code=uint16_t" class="sref">uint16_t//a> /a href="+code=bufmax" class="sref">bufmax//a>);1<116//a>1<117//a>        /spa3 class="comment">/* consult the netfs about the state of an object//spa3.1<118//a>/spa3 class="comment">         * - this func  v3 can be absent if the index carries no state data//spa3.1<119//a>/spa3 class="comment">         * - the netfs data from the cookie being used as the target is//spa3.1<12="va>/spa3 class="comment">         *   presented, as is the auxiliary data//spa3.1<121//a>/spa3 class="comment">         *///spa3.1<122//a>        enumfscache_checkaux//a> (*/a href="+code=check_aux" class="sref">check_aux//a>)(void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>,1<123//a>                                           const void */a href="+code=data" class="sref">data//a>,1<124//a>                                           /a href="+code=uint16_t" class="sref">uint16_t//a> /a href="+code=datalen" class="sref">datalen//a>);1<125//a>1<126//a>        /spa3 class="comment">/* get a3 extra reference on a read context//spa3.1<127//a>/spa3 class="comment">         * - this func  v3 can be absent if the complet v3 func  v3 doesn't//spa3.1<128//a>/spa3 class="comment">         *   require a context//spa3.1<129//a>/spa3 class="comment">         *///spa3.1<130//a>        void (*/a href="+code=get_context" class="sref">get_context//a>)(void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>, void */a href="+code=context" class="sref">context//a>);1<131//a>1<132//a>        /spa3 class="comment">/* release a3 extra reference on a read context//spa3.1<133//a>/spa3 class="comment">         * - this func  v3 can be absent if the complet v3 func  v3 doesn't//spa3.1<134//a>/spa3 class="comment">         *   require a context//spa3.1<135//a>/spa3 class="comment">         *///spa3.1<136//a>        void (*/a href="+code=put_context" class="sref">put_context//a>)(void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>, void */a href="+code=context" class="sref">context//a>);1<137//a>1<138//a>        /spa3 class="comment">/* indicate pages that now have cache metadata retained//spa3.1<139//a>/spa3 class="comment">         * - this func  v3 should mark the specified pages as now being cached//spa3.1<14="va>/spa3 class="comment">         * - the pages will have been marked with PG_fscache before this is//spa3.1<141//a>/spa3 class="comment">         *   called, so this is >
  v3al//spa3.1<142//a>/spa3 class="comment">         *///spa3.1<143//a>        void (*/a href="+code=mark_pages_cached" class="sref">mark_pages_cached//a>)(void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>,1<144//a>                                  structaddress_space//a> */a href="+code=mapping" class="sref">mapping//a>,1<145//a>                                  structpagevec//a> */a href="+code=cached_pvec" class="sref">cached_pvec//a>);1<146//a>1<147//a>        /spa3 class="comment">/* indicate the cookie is no longer cached//spa3.1<148//a>/spa3 class="comment">         * - this func  v3 is called when the backing store currently caching//spa3.1<149//a>/spa3 class="comment">         *   a cookie is removed//spa3.1<15="va>/spa3 class="comment">         * - the netfs should use this to clea3 up any markers indicating//spa3.1<151//a>/spa3 class="comment">         *   cached pages//spa3.1<152//a>/spa3 class="comment">         * - this is manda ory for any object that may have data//spa3.1<153//a>/spa3 class="comment">         *///spa3.1<154//a>        void (*/a href="+code=now_uncached" class="sref">now_uncached//a>)(void */a href="+code=cookie_netfs_data" class="sref">cookie_netfs_data//a>);1<155//a>};1<156//a>1<157//a>/spa3 class="comment">/*//spa3.1<158//a>/spa3 class="comment"> * fscache cached network filesystem typi//spa3.1<159//a>/spa3 class="comment"> * - nami, vers v3 and >
s must be filled in before registrat v3//spa3.1<16="va>/spa3 class="comment"> * - all other fields will be set during registrat v3//spa3.1<161//a>/spa3 class="comment"> *///spa3.1<162//a>structfscache_netfs//a> {1<163//a>        /a href="+code=uint32_t" class="sref">uint32_t//a>                        /a href="+code=vers v3" class="sref">vers v3//a>;        /spa3 class="comment">/* indexing vers v3 *///spa3.1<164//a>        const char<<<<<<<<<<<<<<<<<<<<<<*/a href="+code=nami" class="sref">nami//a>;<<<<<<<<</* filesystem nami2*///spa3.1<165//a>        structfscache_cookie//a><<<<<<<<<<<*/a href="+code=primary_index" class="sref">primary_index//a>;1<166//a>        structlist_head//a>                /a href="+code=link" class="sref">link//a>;<<<<<<<<<< /spa3 class="comment">/* internal link2*///spa3.1<167//a>};1<168//a>1<169//a>/spa3 class="comment">/*//spa3.1<17="va>/spa3 class="comment"> * slow-path func  v3s for when there is actually caching available, and the//spa3.1<171//a>/spa3 class="comment"> * netfs does actually have a valid toke3//spa3.1<172//a>/spa3 class="comment"> * - these are not to be called directly//spa3.1<173//a>/spa3 class="comment"> * - these are undefined symbols when FS-Cache is not configured and the//spa3.1<174//a>/spa3 class="comment"> *   >
  miser takes care of not using them//spa3.1<175//a>/spa3 class="comment"> *///spa3.1<176//a>extern int__fscache_register_netfs//a>(structfscache_netfs//a> *);1<177//a>extern void /a href="+code=__fscache_unregister_netfs" class="sref">__fscache_unregister_netfs//a>(structfscache_netfs//a> *);1<178//a>extern structfscache_cache_tag//a> */a href="+code=__fscache_lookup_cache_tag" class="sref">__fscache_lookup_cache_tag//a>(const char<*);1<179//a>extern void /a href="+code=__fscache_release_cache_tag" class="sref">__fscache_release_cache_tag//a>(structfscache_cache_tag//a> *);1<180//a>1<181//a>extern structfscache_cookie//a><*/a href="+code=__fscache_acquire_cookie" class="sref">__fscache_acquire_cookie//a>(1<182//a>        structfscache_cookie//a><*,1<183//a>        const structfscache_cookie_def//a> *,1<184//a>        void *);1<185//a>extern void /a href="+code=__fscache_relinquish_cookie" class="sref">__fscache_relinquish_cookie//a>(structfscache_cookie//a><*, int);1<186//a>extern void /a href="+code=__fscache_update_cookie" class="sref">__fscache_update_cookie//a>(structfscache_cookie//a><*);1<187//a>extern int__fscache_attr_changed//a>(structfscache_cookie//a><*);1<188//a>extern int__fscache_read_or_alloc_page//a>(structfscache_cookie//a><*,1<189//a>                                        structpage//a> *,1<190//a>                                        /a href="+code=fscache_rw_complete_t" class="sref">fscache_rw_complete_t//a>,1<191//a>                                        void *,1<192//a>                                        /a href="+code=gfp_t" class="sref">gfp_t//a>);1<193//a>extern int__fscache_read_or_alloc_pages//a>(structfscache_cookie//a><*,1<194//a>                                         structaddress_space//a> *,1<195//a>                                         structlist_head//a> *,1<196//a>                                         unsigned *,1<197//a>                                         /a href="+code=fscache_rw_complete_t" class="sref">fscache_rw_complete_t//a>,1<198//a>                                         void *,1<199//a>                                         /a href="+code=gfp_t" class="sref">gfp_t//a>);1<200"va>extern int__fscache_alloc_page//a>(structfscache_cookie//a><*, structpage//a> *, /a href="+code=gfp_t" class="sref">gfp_t//a>);1<201"va>extern int__fscache_write_page//a>(structfscache_cookie//a><*, structpage//a> *, /a href="+code=gfp_t" class="sref">gfp_t//a>);1<202//a>extern void /a href="+code=__fscache_uncache_page" class="sref">__fscache_uncache_page//a>(structfscache_cookie//a><*, structpage//a> *);1<203//a>extern /a href="+code=bool" class="sref">bool//a> /a href="+code=__fscache_check_page_write" class="sref">__fscache_check_page_write//a>(structfscache_cookie//a><*, structpage//a> *);1<204//a>extern void /a href="+code=__fscache_wait_on_page_write" class="sref">__fscache_wait_on_page_write//a>(structfscache_cookie//a><*, structpage//a> *);1<205//a>extern /a href="+code=bool" class="sref">bool//a> /a href="+code=__fscache_maybe_release_page" class="sref">__fscache_maybe_release_page//a>(structfscache_cookie//a><*, structpage//a> *,1<206//a>                                         /a href="+code=gfp_t" class="sref">gfp_t//a>);1<207//a>extern void /a href="+code=__fscache_uncache_all_inode_pages" class="sref">__fscache_uncache_all_inode_pages//a>(structfscache_cookie//a><*,1<208//a>                                              structinode//a> *);1<209//a>1<2e="va>/spa3 class="comment">/**//spa3.1<211//a>/spa3 class="comment"> * fscache_register_netfs - Register a filesystem as desiring caching services//spa3.1<212//a>/spa3 class="comment"> * @netfs: The descri
  v3 of the filesystem//spa3.1<213//a>/spa3 class="comment"> *//spa3.1<214//a>/spa3 class="comment"> * Register a filesystem as desiring caching services if they're available.//spa3.1<215//a>/spa3 class="comment"> *//spa3.1<216//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<217//a>/spa3 class="comment"> * descri
  v3.//spa3.1<218//a>/spa3 class="comment"> *///spa3.1<219//a>stat cinline//a>1<22="va>intfscache_register_netfs//a>(structfscache_netfs//a> */a href="+code=netfs" class="sref">netfs//a>)1<221//a>{1<222//a>        if (/a href="+code=fscache_available" class="sref">fscache_available//a>())1<223//a>                return /a href="+code=__fscache_register_netfs" class="sref">__fscache_register_netfs//a>(/a href="+code=netfs" class="sref">netfs//a>);1<224//a>        else1<225//a>                return 0;1<226//a>}1<227//a>1<228//a>/spa3 class="comment">/**//spa3.1<229//a>/spa3 class="comment"> * fscache_unregister_netfs - Indicate that a filesystem no longer desires//spa3.1<23="va>/spa3 class="comment"> * caching services//spa3.1<231//a>/spa3 class="comment"> * @netfs: The descri
  v3 of the filesystem//spa3.1<232//a>/spa3 class="comment"> *//spa3.1<233//a>/spa3 class="comment"> * Indicate that a filesystem no longer desires caching services for the//spa3.1<234//a>/spa3 class="comment"> * moment.//spa3.1<235//a>/spa3 class="comment"> *//spa3.1<236//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<237//a>/spa3 class="comment"> * descri
  v3.//spa3.1<238//a>/spa3 class="comment"> *///spa3.1<239//a>stat cinline//a>1<24="va>void /a href="+code=fscache_unregister_netfs" class="sref">fscache_unregister_netfs//a>(structfscache_netfs//a> */a href="+code=netfs" class="sref">netfs//a>)1<241//a>{1<242//a>        if (/a href="+code=fscache_available" class="sref">fscache_available//a>())1<243//a>                /a href="+code=__fscache_unregister_netfs" class="sref">__fscache_unregister_netfs//a>(/a href="+code=netfs" class="sref">netfs//a>);1<244//a>}1<245//a>1<246//a>/spa3 class="comment">/**//spa3.1<247//a>/spa3 class="comment"> * fscache_lookup_cache_tag - Look up a cache tag//spa3.1<248//a>/spa3 class="comment"> * @nami: The nami2of the tag to search for//spa3.1<249//a>/spa3 class="comment"> *//spa3.1<25="va>/spa3 class="comment"> * Acquire a specific cache referral tag that can be used to select a specific//spa3.1<251//a>/spa3 class="comment"> * cache in which to cache an index.//spa3.1<252//a>/spa3 class="comment"> *//spa3.1<253//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<254//a>/spa3 class="comment"> * descri
  v3.//spa3.1<255//a>/spa3 class="comment"> *///spa3.1<256//a>stat cinline//a>1<257//a>structfscache_cache_tag//a> */a href="+code=fscache_lookup_cache_tag" class="sref">fscache_lookup_cache_tag//a>(const char<*/a href="+code=nami" class="sref">nami//a>)1<258//a>{1<259//a>        if (/a href="+code=fscache_available" class="sref">fscache_available//a>())1<260//a>                return /a href="+code=__fscache_lookup_cache_tag" class="sref">__fscache_lookup_cache_tag//a>(/a href="+code=nami" class="sref">nami//a>);1<261//a>        else1<262//a>                return /a href="+code=NULL" class="sref">NULL//a>;1<263//a>}1<264//a>1<265//a>/spa3 class="comment">/**//spa3.1<266//a>/spa3 class="comment"> * fscache_release_cache_tag - Release a cache tag//spa3.1<267//a>/spa3 class="comment"> * @tag: The tag to release//spa3.1<268//a>/spa3 class="comment"> *//spa3.1<269//a>/spa3 class="comment"> * Release a reference to a cache referral tag previously looked up.//spa3.1<27="va>/spa3 class="comment"> *//spa3.1<271//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<272//a>/spa3 class="comment"> * descri
  v3.//spa3.1<273//a>/spa3 class="comment"> *///spa3.1<274//a>stat cinline//a>1<275//a>void /a href="+code=fscache_release_cache_tag" class="sref">fscache_release_cache_tag//a>(structfscache_cache_tag//a> */a href="+code=tag" class="sref">tag//a>)1<276//a>{1<277//a>        if (/a href="+code=fscache_available" class="sref">fscache_available//a>())1<278//a>                /a href="+code=__fscache_release_cache_tag" class="sref">__fscache_release_cache_tag//a>(/a href="+code=tag" class="sref">tag//a>);1<279//a>}1<280//a>1<281//a>/spa3 class="comment">/**//spa3.1<282//a>/spa3 class="comment"> * fscache_acquire_cookie - Acquire a cookie to represent a cache object//spa3.1<283//a>/spa3 class="comment"> * @parent: The cookie that's to be the parent2of this >ne//spa3.1<284//a>/spa3 class="comment"> * @def: A descri
  v3 of the cache object, including callback operat v3s//spa3.1<285//a>/spa3 class="comment"> * @netfs_data: An arbitrary pieci2of data to be kept in the cookie to//spa3.1<286//a>/spa3 class="comment"> * represent the cache object to the netfs//spa3.1<287//a>/spa3 class="comment"> *//spa3.1<288//a>/spa3 class="comment"> * This func  v3 is used to inform FS-Cache about part of an index hierarchy//spa3.1<289//a>/spa3 class="comment"> * that can be used to locate files.  This is done by requesting a cookie for//spa3.1<29="va>/spa3 class="comment"> * each index in the path to the file.//spa3.1<291//a>/spa3 class="comment"> *//spa3.1<292//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<293//a>/spa3 class="comment"> * descri
  v3.//spa3.1<294//a>/spa3 class="comment"> *///spa3.1<295//a>stat cinline//a>1<296//a>structfscache_cookie//a><*/a href="+code=fscache_acquire_cookie" class="sref">fscache_acquire_cookie//a>(1<297//a>        structfscache_cookie//a><*/a href="+code=parent" class="sref">parent//a>,1<298//a>        const structfscache_cookie_def//a> */a href="+code=def" class="sref">def//a>,1<299//a>        void */a href="+code=netfs_data" class="sref">netfs_data//a>)1<300"va>{1<301//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=parent" class="sref">parent//a>))1<302//a>                return /a href="+code=__fscache_acquire_cookie" class="sref">__fscache_acquire_cookie//a>(/a href="+code=parent" class="sref">parent//a>, /a href="+code=def" class="sref">def//a>, /a href="+code=netfs_data" class="sref">netfs_data//a>);1<303//a>        else1<304//a>                return /a href="+code=NULL" class="sref">NULL//a>;1<305//a>}1<306//a>1<307//a>/spa3 class="comment">/**//spa3.1<308//a>/spa3 class="comment"> * fscache_relinquish_cookie - Return the cookie to the cache, maybe discarding//spa3.1<309//a>/spa3 class="comment"> * it//spa3.1<3e="va>/spa3 class="comment"> * @cookie: The cookie being returned//spa3.1<311//a>/spa3 class="comment"> * @retire: True if the cache object the cookie represents is to be discarded//spa3.1<312//a>/spa3 class="comment"> *//spa3.1<313//a>/spa3 class="comment"> * This func  v3 returns a cookie to the cache, forcibly discarding the//spa3.1<314//a>/spa3 class="comment"> * associated cache object if retire is set to true.//spa3.1<315//a>/spa3 class="comment"> *//spa3.1<316//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<317//a>/spa3 class="comment"> * descri
  v3.//spa3.1<318//a>/spa3 class="comment"> *///spa3.1<319//a>stat cinline//a>1<32="va>void /a href="+code=fscache_relinquish_cookie" class="sref">fscache_relinquish_cookie//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>, intretire//a>)1<321//a>{1<322//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<323//a>                /a href="+code=__fscache_relinquish_cookie" class="sref">__fscache_relinquish_cookie//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=retire" class="sref">retire//a>);1<324//a>}1<325//a>1<326//a>/spa3 class="comment">/**//spa3.1<327//a>/spa3 class="comment"> * fscache_update_cookie - Request that a cache object be updated//spa3.1<328//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<329//a>/spa3 class="comment"> *//spa3.1<33="va>/spa3 class="comment"> * Request a3 update of the index data for the cache object associated with the//spa3.1<331//a>/spa3 class="comment"> * cookie.//spa3.1<332//a>/spa3 class="comment"> *//spa3.1<333//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<334//a>/spa3 class="comment"> * descri
  v3.//spa3.1<335//a>/spa3 class="comment"> *///spa3.1<336//a>stat cinline//a>1<337//a>void /a href="+code=fscache_update_cookie" class="sref">fscache_update_cookie//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>)1<338//a>{1<339//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<340//a>                /a href="+code=__fscache_update_cookie" class="sref">__fscache_update_cookie//a>(/a href="+code=cookie" class="sref">cookie//a>);1<341//a>}1<342//a>1<343//a>/spa3 class="comment">/**//spa3.1<344//a>/spa3 class="comment"> * fscache_pin_cookie - Pin a data-storage cache object in its cache//spa3.1<345//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<346//a>/spa3 class="comment"> *//spa3.1<347//a>/spa3 class="comment"> * Permit data-storage cache objects to be pinned in the cache.//spa3.1<348//a>/spa3 class="comment"> *//spa3.1<349//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<35="va>/spa3 class="comment"> * descri
  v3.//spa3.1<351//a>/spa3 class="comment"> *///spa3.1<352//a>stat cinline//a>1<353//a>intfscache_pin_cookie//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>)1<354//a>{1<355//a>        return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>;1<356//a>}1<357//a>1<358//a>/spa3 class="comment">/**//spa3.1<359//a>/spa3 class="comment"> * fscache_pin_cookie - Unpin a data-storage cache object in its cache//spa3.1<36="va>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<361//a>/spa3 class="comment"> *//spa3.1<362//a>/spa3 class="comment"> * Permit data-storage cache objects to be unpinned from the cache.//spa3.1<363//a>/spa3 class="comment"> *//spa3.1<364//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<365//a>/spa3 class="comment"> * descri
  v3.//spa3.1<366//a>/spa3 class="comment"> *///spa3.1<367//a>stat cinline//a>1<368//a>void /a href="+code=fscache_unpin_cookie" class="sref">fscache_unpin_cookie//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>)1<369//a>{1<37="va>}1<371//a>1<372//a>/spa3 class="comment">/**//spa3.1<373//a>/spa3 class="comment"> * fscache_attr_changed - Notify cache that an object's attributes changed//spa3.1<374//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<375//a>/spa3 class="comment"> *//spa3.1<376//a>/spa3 class="comment"> * Send a notificat v3 to the cache indicat ng that an object's attributes have//spa3.1<377//a>/spa3 class="comment"> * changed.  This includes the data size.  These attributes will be obtained//spa3.1<378//a>/spa3 class="comment"> * through the get_attr() cookie defini  v3 op.//spa3.1<379//a>/spa3 class="comment"> *//spa3.1<38="va>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<381//a>/spa3 class="comment"> * descri
  v3.//spa3.1<382//a>/spa3 class="comment"> *///spa3.1<383//a>stat cinline//a>1<384//a>intfscache_attr_changed//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>)1<385//a>{1<386//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<387//a>                return /a href="+code=__fscache_attr_changed" class="sref">__fscache_attr_changed//a>(/a href="+code=cookie" class="sref">cookie//a>);1<388//a>        else1<389//a>                return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>;1<39="va>}1<391//a>1<392//a>/spa3 class="comment">/**//spa3.1<393//a>/spa3 class="comment"> * fscache_reserve_space - Reserve data space for a cached object//spa3.1<394//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<395//a>/spa3 class="comment"> * @i_size: The amount2of space to be reserved//spa3.1<396//a>/spa3 class="comment"> *//spa3.1<397//a>/spa3 class="comment"> * Reserve a3 amount2of space in the cache for the cache object attached to a//spa3.1<398//a>/spa3 class="comment"> * cookie so that a write to that object within the space can always be//spa3.1<399//a>/spa3 class="comment"> * honoured.//spa3.1<40="va>/spa3 class="comment"> *//spa3.1<401//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<402//a>/spa3 class="comment"> * descri
  v3.//spa3.1<403//a>/spa3 class="comment"> *///spa3.1<404//a>stat cinline//a>1<405//a>intfscache_reserve_space//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=loff_t" class="sref">loff_t//a>size//a>)1<406//a>{1<407//a>        return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>;1<408//a>}1<409//a>1<4e="va>/spa3 class="comment">/**//spa3.1<411//a>/spa3 class="comment"> * fscache_read_or_alloc_page - Read a page from the cache or allocate a block//spa3.1<412//a>/spa3 class="comment"> * in which to store it//spa3.1<413//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<414//a>/spa3 class="comment"> * @page: The netfs page to fill if possible//spa3.1<415//a>/spa3 class="comment"> * @end_io_func: The callback to invoke when and if the page is filled//spa3.1<416//a>/spa3 class="comment"> * @context: An arbitrary pieci2of data to pass v3 to end_io_func()//spa3.1<417//a>/spa3 class="comment"> * @gfp: The condi  v3s under which memory allocat v3 should be made//spa3.1<418//a>/spa3 class="comment"> *//spa3.1<419//a>/spa3 class="comment"> * Read a page from the cache, or if that's not possible make a potential//spa3.1<42="va>/spa3 class="comment"> * one-block reservat v3 in the cache into which the page may be stored once//spa3.1<421//a>/spa3 class="comment"> * fetched from the server.//spa3.1<422//a>/spa3 class="comment"> *//spa3.1<423//a>/spa3 class="comment"> * If the page is not backed by the cache object, or if it there's some reason//spa3.1<424//a>/spa3 class="comment"> * it can't be, -ENOBUFS will be returned and nothing more will be done for//spa3.1<425//a>/spa3 class="comment"> * that page.//spa3.1<426//a>/spa3 class="comment"> *//spa3.1<427//a>/spa3 class="comment"> * Else, if that page is backed by the cache, a read will be ini  ated directly//spa3.1<428//a>/spa3 class="comment"> * to the netfs's page and 0 will be returned by this func  v3.  The//spa3.1<429//a>/spa3 class="comment"> * end_io_func() callback will be invoked when the operat v3 terminates v3 a//spa3.1<43="va>/spa3 class="comment"> * complet v3 or failure.  Note that the callback may be invoked before the//spa3.1<431//a>/spa3 class="comment"> * return.//spa3.1<432//a>/spa3 class="comment"> *//spa3.1<433//a>/spa3 class="comment"> * Else, if the page is unbacked, -ENODATA is returned and a block may have//spa3.1<434//a>/spa3 class="comment"> * been allocated in the cache.//spa3.1<435//a>/spa3 class="comment"> *//spa3.1<436//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<437//a>/spa3 class="comment"> * descri
  v3.//spa3.1<438//a>/spa3 class="comment"> *///spa3.1<439//a>stat cinline//a>1<440//a>intfscache_read_or_alloc_page//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<441//a>                               structpage//a><*/a href="+code=page" class="sref">page//a>,1<442//a>                               /a href="+code=fscache_rw_complete_t" class="sref">fscache_rw_complete_t//a>end_io_func//a>,1<443//a>                               void */a href="+code=context" class="sref">context//a>,1<444//a>                               /a href="+code=gfp_t" class="sref">gfp_t//a>gfp//a>)1<445//a>{1<446//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<447//a>                return /a href="+code=__fscache_read_or_alloc_page" class="sref">__fscache_read_or_alloc_page//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=page" class="sref">page//a>,end_io_func//a>,1<448//a>                                                    /a href="+code=context" class="sref">context//a>,gfp//a>);1<449//a>        else1<450//a>                return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>;1<451//a>}1<452//a>1<453//a>/spa3 class="comment">/**//spa3.1<454//a>/spa3 class="comment"> * fscache_read_or_alloc_pages - Read pages from the cache and/or allocate//spa3.1<455//a>/spa3 class="comment"> * blocks in which to store them//spa3.1<456//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<457//a>/spa3 class="comment"> * @mapping: The netfs inode mapping to which the pages will be attached//spa3.1<458//a>/spa3 class="comment"> * @pages: A list2of potential netfs pages to be filled//spa3.1<459//a>/spa3 class="comment"> * @nr_pages: Number2of pages to be read and/or allocated//spa3.1<46="va>/spa3 class="comment"> * @end_io_func: The callback to invoke when and if each page is filled//spa3.1<461//a>/spa3 class="comment"> * @context: An arbitrary pieci2of data to pass v3 to end_io_func()//spa3.1<462//a>/spa3 class="comment"> * @gfp: The condi  v3s under which memory allocat v3 should be made//spa3.1<463//a>/spa3 class="comment"> *//spa3.1<464//a>/spa3 class="comment"> * Read a set of pages from the cache, or if that's not possible, attempt to//spa3.1<465//a>/spa3 class="comment"> * make a potential one-block reservat v3 for each page in the cache into which//spa3.1<466//a>/spa3 class="comment"> * that page may be stored once fetched from the server.//spa3.1<467//a>/spa3 class="comment"> *//spa3.1<468//a>/spa3 class="comment"> * If some pages are not backed by the cache object, or if it there's some//spa3.1<469//a>/spa3 class="comment"> * reason they can't be, -ENOBUFS will be returned and nothing more will be//spa3.1<47="va>/spa3 class="comment"> * done for that pages.//spa3.1<471//a>/spa3 class="comment"> *//spa3.1<472//a>/spa3 class="comment"> * Else, if some of the pages are backed by the cache, a read will be ini  ated//spa3.1<473//a>/spa3 class="comment"> * directly to the netfs's page and 0 will be returned by this func  v3.  The//spa3.1<474//a>/spa3 class="comment"> * end_io_func() callback will be invoked when the operat v3 terminates v3 a//spa3.1<475//a>/spa3 class="comment"> * complet v3 or failure.  Note that the callback may be invoked before the//spa3.1<476//a>/spa3 class="comment"> * return.//spa3.1<477//a>/spa3 class="comment"> *//spa3.1<478//a>/spa3 class="comment"> * Else, if a page is unbacked, -ENODATA is returned and a block may have//spa3.1<479//a>/spa3 class="comment"> * been allocated in the cache.//spa3.1<48="va>/spa3 class="comment"> *//spa3.1<481//a>/spa3 class="comment"> * Because the func  v3 may want to return all of -ENOBUFS, -ENODATA and 0 in//spa3.1<482//a>/spa3 class="comment"> * regard to different2pages, the return values are priori  sed in that order.//spa3.1<483//a>/spa3 class="comment"> * Any pages submitted for reading are removed from the pages list.//spa3.1<484//a>/spa3 class="comment"> *//spa3.1<485//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<486//a>/spa3 class="comment"> * descri
  v3.//spa3.1<487//a>/spa3 class="comment"> *///spa3.1<488//a>stat cinline//a>1<489//a>intfscache_read_or_alloc_pages//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<490//a>                                structaddress_space//a><*/a href="+code=mapping" class="sref">mapping//a>,1<491//a>                                structlist_head//a><*/a href="+code=pages" class="sref">pages//a>,1<492//a>                                unsigned */a href="+code=nr_pages" class="sref">nr_pages//a>,1<493//a>                                /a href="+code=fscache_rw_complete_t" class="sref">fscache_rw_complete_t//a>end_io_func//a>,1<494//a>                                void */a href="+code=context" class="sref">context//a>,1<495//a>                                /a href="+code=gfp_t" class="sref">gfp_t//a>gfp//a>)1<496//a>{1<497//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<498//a>                return /a href="+code=__fscache_read_or_alloc_pages" class="sref">__fscache_read_or_alloc_pages//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=mapping" class="sref">mapping//a>, /a href="+code=pages" class="sref">pages//a>,1<499//a>                                                     /a href="+code=nr_pages" class="sref">nr_pages//a>,end_io_func//a>,1<500//a>                                                     /a href="+code=context" class="sref">context//a>,gfp//a>);1<501//a>        else1<502//a>                return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>;1<503//a>}1<504//a>1<505//a>/spa3 class="comment">/**//spa3.1<506//a>/spa3 class="comment"> * fscache_alloc_page - Allocate a block in which to store a page//spa3.1<507//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<508//a>/spa3 class="comment"> * @page: The netfs page to allocate a page for//spa3.1<509//a>/spa3 class="comment"> * @gfp: The condi  v3s under which memory allocat v3 should be made//spa3.1<5e="va>/spa3 class="comment"> *//spa3.1<511//a>/spa3 class="comment"> * Request Allocat v3 a block in the cache in which to store a netfs page//spa3.1<512//a>/spa3 class="comment"> * without retrieving any contents from the cache.//spa3.1<513//a>/spa3 class="comment"> *//spa3.1<514//a>/spa3 class="comment"> * If the page is not backed by a file then -ENOBUFS will be returned and//spa3.1<515//a>/spa3 class="comment"> * nothing more will be done, and no reservat v3 will be made.//spa3.1<516//a>/spa3 class="comment"> *//spa3.1<517//a>/spa3 class="comment"> * Else, a block will be allocated if one wasn't already, and 0 will be//spa3.1<518//a>/spa3 class="comment"> * returned//spa3.1<519//a>/spa3 class="comment"> *//spa3.1<52="va>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<521//a>/spa3 class="comment"> * descri
  v3.//spa3.1<522//a>/spa3 class="comment"> *///spa3.1<523//a>stat cinline//a>1<524//a>intfscache_alloc_page//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<525//a>                       structpage//a><*/a href="+code=page" class="sref">page//a>,1<526//a>                       /a href="+code=gfp_t" class="sref">gfp_t//a>gfp//a>)1<527//a>{1<528//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<529//a>                return /a href="+code=__fscache_alloc_page" class="sref">__fscache_alloc_page//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=page" class="sref">page//a>,gfp//a>);1<530//a>        else1<531//a>                return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>;1<532//a>}1<533//a>1<534//a>/spa3 class="comment">/**//spa3.1<535//a>/spa3 class="comment"> * fscache_write_page - Request storage of a page in the cache//spa3.1<536//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<537//a>/spa3 class="comment"> * @page: The netfs page to store//spa3.1<538//a>/spa3 class="comment"> * @gfp: The condi  v3s under which memory allocat v3 should be made//spa3.1<539//a>/spa3 class="comment"> *//spa3.1<54="va>/spa3 class="comment"> * Request the contents of the netfs page be written into the cache.  This//spa3.1<541//a>/spa3 class="comment"> * request may be ignored if no cache block is currently allocated, in which//spa3.1<542//a>/spa3 class="comment"> * case it will return -ENOBUFS.//spa3.1<543//a>/spa3 class="comment"> *//spa3.1<544//a>/spa3 class="comment"> * If a cache block was already allocated, a write will be ini  ated and 0 will//spa3.1<545//a>/spa3 class="comment"> * be returned.  The PG_fscache_write page bit is set immed ately and will then//spa3.1<546//a>/spa3 class="comment"> * be cleared at the complet v3 of the write to indicate the success vr failure//spa3.1<547//a>/spa3 class="comment"> * of the operat v3.  Note that the complet v3 may happen before the return.//spa3.1<548//a>/spa3 class="comment"> *//spa3.1<549//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<55="va>/spa3 class="comment"> * descri
  v3.//spa3.1<551//a>/spa3 class="comment"> *///spa3.1<552//a>stat cinline//a>1<553//a>intfscache_write_page//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<554//a>                       structpage//a><*/a href="+code=page" class="sref">page//a>,1<555//a>                       /a href="+code=gfp_t" class="sref">gfp_t//a>gfp//a>)1<556//a>{1<557//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<558//a>                return /a href="+code=__fscache_write_page" class="sref">__fscache_write_page//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=page" class="sref">page//a>,gfp//a>);1<559//a>        else1<560//a>                return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>;1<561//a>}1<562//a>1<563//a>/spa3 class="comment">/**//spa3.1<564//a>/spa3 class="comment"> * fscache_uncache_page - Indicate that caching is no longer required on a page//spa3.1<565//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<566//a>/spa3 class="comment"> * @page: The netfs page that was being cached.//spa3.1<567//a>/spa3 class="comment"> *//spa3.1<568//a>/spa3 class="comment"> * Tell the cache that we no longer want a page to be cached and that it should//spa3.1<569//a>/spa3 class="comment"> * remove any knowledge of the netfs page it may have.//spa3.1<57="va>/spa3 class="comment"> *//spa3.1<571//a>/spa3 class="comment"> * Note that this cannot cancel any outstanding I/O operat v3s between this//spa3.1<572//a>/spa3 class="comment"> * page and the cache.//spa3.1<573//a>/spa3 class="comment"> *//spa3.1<574//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<575//a>/spa3 class="comment"> * descri
  v3.//spa3.1<576//a>/spa3 class="comment"> *///spa3.1<577//a>stat cinline//a>1<578//a>void /a href="+code=fscache_uncache_page" class="sref">fscache_uncache_page//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<579//a>                          structpage//a><*/a href="+code=page" class="sref">page//a>)1<58="va>{1<581//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<582//a>                /a href="+code=__fscache_uncache_page" class="sref">__fscache_uncache_page//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=page" class="sref">page//a>);1<583//a>}1<584//a>1<585//a>/spa3 class="comment">/**//spa3.1<586//a>/spa3 class="comment"> * fscache_check_page_write - Ask if a page is being writing to the cache//spa3.1<587//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<588//a>/spa3 class="comment"> * @page: The netfs page that is being cached.//spa3.1<589//a>/spa3 class="comment"> *//spa3.1<59="va>/spa3 class="comment"> * Ask the cache if a page is being written to the cache.//spa3.1<591//a>/spa3 class="comment"> *//spa3.1<592//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<593//a>/spa3 class="comment"> * descri
  v3.//spa3.1<594//a>/spa3 class="comment"> *///spa3.1<595//a>stat cinline//a>1<596//a>/a href="+code=bool" class="sref">bool//a>fscache_check_page_write//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<597//a>                              structpage//a><*/a href="+code=page" class="sref">page//a>)1<598//a>{1<599//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<600//a>                return /a href="+code=__fscache_check_page_write" class="sref">__fscache_check_page_write//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=page" class="sref">page//a>);1<601//a>        return /a href="+code=false" class="sref">false//a>;1<602//a>}1<603//a>1<604//a>/spa3 class="comment">/**//spa3.1<605//a>/spa3 class="comment"> * fscache_wait_on_page_write - Wait for a page to complete writing to the cache//spa3.1<606//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<607//a>/spa3 class="comment"> * @page: The netfs page that is being cached.//spa3.1<608//a>/spa3 class="comment"> *//spa3.1<609//a>/spa3 class="comment"> * Ask the cache to wake us up when a page is no longer being written to the//spa3.1<6e="va>/spa3 class="comment"> * cache.//spa3.1<611//a>/spa3 class="comment"> *//spa3.1<612//a>/spa3 class="comment"> * See Documentat v3/filesystems/caching/netfs-api.txt for a complete//spa3.1<613//a>/spa3 class="comment"> * descri
  v3.//spa3.1<614//a>/spa3 class="comment"> *///spa3.1<615//a>stat cinline//a>1<616//a>void /a href="+code=fscache_wait_on_page_write" class="sref">fscache_wait_on_page_write//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<617//a>                                structpage//a><*/a href="+code=page" class="sref">page//a>)1<618//a>{1<619//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<620//a>                /a href="+code=__fscache_wait_on_page_write" class="sref">__fscache_wait_on_page_write//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=page" class="sref">page//a>);1<621//a>}1<622//a>1<623//a>/spa3 class="comment">/**//spa3.1<624//a>/spa3 class="comment"> * fscache_maybe_release_page - Consider releasing a page, cancelling a store//spa3.1<625//a>/spa3 class="comment"> * @cookie: The cookie representing the cache object//spa3.1<626//a>/spa3 class="comment"> * @page: The netfs page that is being cached.//spa3.1<627//a>/spa3 class="comment"> * @gfp: The gfp flags passed to releasepage()//spa3.1<628//a>/spa3 class="comment"> *//spa3.1<629//a>/spa3 class="comment"> * Consider releasing a page for the vmscan algori hm, on behalf of the netfs's//spa3.1<63="va>/spa3 class="comment"> * releasepage() call.  A storage request on the page may cancelled if it is//spa3.1<631//a>/spa3 class="comment"> * not currently being processed.//spa3.1<632//a>/spa3 class="comment"> *//spa3.1<633//a>/spa3 class="comment"> * The func  v3 returns true if the page no longer has a storage request on it,//spa3.1<634//a>/spa3 class="comment"> * and false if a storage request is left in place.  If true is returned, the//spa3.1<635//a>/spa3 class="comment"> * page will have been passed to fscache_uncache_page().  If false is returned//spa3.1<636//a>/spa3 class="comment"> * the page cannot be freed yet.//spa3.1<637//a>/spa3 class="comment"> *///spa3.1<638//a>stat cinline//a>1<639//a>/a href="+code=bool" class="sref">bool//a>fscache_maybe_release_page//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<640//a>                                structpage//a><*/a href="+code=page" class="sref">page//a>,1<641//a>                                /a href="+code=gfp_t" class="sref">gfp_t//a>gfp//a>)1<642//a>{1<643//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>) &&PageFsCache//a>(/a href="+code=page" class="sref">page//a>))1<644//a>                return /a href="+code=__fscache_maybe_release_page" class="sref">__fscache_maybe_release_page//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=page" class="sref">page//a>,gfp//a>);1<645//a>        return /a href="+code=false" class="sref">false//a>;1<646//a>}1<647//a>1<648//a>/spa3 class="comment">/**//spa3.1<649//a>/spa3 class="comment"> * fscache_uncache_all_inode_pages - Uncache all an inode's pages//spa3.1<65="va>/spa3 class="comment"> * @cookie: The cookie representing the inode's cache object.//spa3.1<651//a>/spa3 class="comment"> * @inode: The inode to uncache pages from.//spa3.1<652//a>/spa3 class="comment"> *//spa3.1<653//a>/spa3 class="comment"> * Uncache all the pages in an inode that are marked PG_fscache, assuming them//spa3.1<654//a>/spa3 class="comment"> * to be assoc ated with the given cookie.//spa3.1<655//a>/spa3 class="comment"> *//spa3.1<656//a>/spa3 class="comment"> * This func  v3 may sleep.  It will wait for pages that are being written out//spa3.1<657//a>/spa3 class="comment"> * and will wait whilst the PG_fscache mark is removed by the cache.//spa3.1<658//a>/spa3 class="comment"> *///spa3.1<659//a>stat cinline//a>1<660//a>void /a href="+code=fscache_uncache_all_inode_pages" class="sref">fscache_uncache_all_inode_pages//a>(structfscache_cookie//a><*/a href="+code=cookie" class="sref">cookie//a>,1<661//a>                                     structinode//a><*/a href="+code=inode" class="sref">inode//a>)1<662//a>{1<663//a>        if (/a href="+code=fscache_cookie_valid" class="sref">fscache_cookie_valid//a>(/a href="+code=cookie" class="sref">cookie//a>))1<664//a>                /a href="+code=__fscache_uncache_all_inode_pages" class="sref">__fscache_uncache_all_inode_pages//a>(/a href="+code=cookie" class="sref">cookie//a>, /a href="+code=inode" class="sref">inode//a>);1<665//a>}1<666//a>1<667//a>#endif /spa3 class="comment">/* _LINUX_FSCACHE_H *///spa3.1<668//a>//pre>//div>


//div>