~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to Documentation/filesystems/caching/netfs-api.txt

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
the tree.  The netfs can even mix indices and data files at the same level, but
96
96
it's not recommended.
97
97
 
98
 
Each index entry consists of a key of indeterminate length plus some auxilliary
 
98
Each index entry consists of a key of indeterminate length plus some auxiliary
99
99
data, also of indeterminate length.
100
100
 
101
101
There are some limits on indices:
203
203
 
204
204
     If the function is absent, a file size of 0 is assumed.
205
205
 
206
 
 (6) A function to retrieve auxilliary data from the netfs [optional].
 
206
 (6) A function to retrieve auxiliary data from the netfs [optional].
207
207
 
208
208
     This function will be called with the netfs data that was passed to the
209
 
     cookie acquisition function and the maximum length of auxilliary data that
210
 
     it may provide.  It should write the auxilliary data into the given buffer
 
209
     cookie acquisition function and the maximum length of auxiliary data that
 
210
     it may provide.  It should write the auxiliary data into the given buffer
211
211
     and return the quantity it wrote.
212
212
 
213
 
     If this function is absent, the auxilliary data length will be set to 0.
 
213
     If this function is absent, the auxiliary data length will be set to 0.
214
214
 
215
 
     The length of the auxilliary data buffer may be dependent on the key
 
215
     The length of the auxiliary data buffer may be dependent on the key
216
216
     length.  A netfs mustn't rely on being able to provide more than 400 bytes
217
217
     for both.
218
218
 
219
 
 (7) A function to check the auxilliary data [optional].
 
219
 (7) A function to check the auxiliary data [optional].
220
220
 
221
221
     This function will be called to check that a match found in the cache for
222
 
     this object is valid.  For instance with AFS it could check the auxilliary
 
222
     this object is valid.  For instance with AFS it could check the auxiliary
223
223
     data against the data version number returned by the server to determine
224
224
     whether the index entry in a cache is still valid.
225
225
 
232
232
        (*) FSCACHE_CHECKAUX_NEEDS_UPDATE       - the entry requires update
233
233
        (*) FSCACHE_CHECKAUX_OBSOLETE           - the entry should be deleted
234
234
 
235
 
     This function can also be used to extract data from the auxilliary data in
 
235
     This function can also be used to extract data from the auxiliary data in
236
236
     the cache and copy it into the netfs's structures.
237
237
 
238
238
 (8) A pair of functions to manage contexts for the completion callback
673
673
in which case the page will not be stored in the cache this time.
674
674
 
675
675
 
 
676
BULK INODE PAGE UNCACHE
 
677
-----------------------
 
678
 
 
679
A convenience routine is provided to perform an uncache on all the pages
 
680
attached to an inode.  This assumes that the pages on the inode correspond on a
 
681
1:1 basis with the pages in the cache.
 
682
 
 
683
        void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
 
684
                                             struct inode *inode);
 
685
 
 
686
This takes the netfs cookie that the pages were cached with and the inode that
 
687
the pages are attached to.  This function will wait for pages to finish being
 
688
written to the cache and for the cache to finish with the page generally.  No
 
689
error is returned.
 
690
 
 
691
 
676
692
==========================
677
693
INDEX AND DATA FILE UPDATE
678
694
==========================