Lines Matching refs:to
10 FS-Cache to make finding objects faster and to make retiring of groups of
15 need to care.
70 (3) The cookie representing the primary index will be allocated according to
73 For example, kAFS (linux/fs/afs/) uses the following definitions to describe
91 (2) To make it easier to discard a subset of all the files cached based around
92 a particular key - for instance to mirror the removal of an AFS volume.
94 However, since it's unlikely that any two netfs's are going to want to define
95 their index hierarchies in quite the same way, FS-Cache tries to impose as few
105 (1) Any index containing non-index objects should be restricted to a single
110 (2) The entry data must be atomically journallable, so it is limited to about
179 (3) A function to select the cache in which to store an index [optional].
181 This function is invoked when an index needs to be instantiated in a cache
185 need to be supplied for any non-index object or any index that will only
192 (4) A function to retrieve an object's key from the netfs [mandatory].
194 This function will be called with the netfs data that was passed to the
199 (5) A function to retrieve attribute data from the netfs [optional].
201 This function will be called with the netfs data that was passed to the
203 this is a data file. The size may be used to govern how much cache must
208 (6) A function to retrieve auxiliary data from the netfs [optional].
210 This function will be called with the netfs data that was passed to the
215 If this function is absent, the auxiliary data length will be set to 0.
218 length. A netfs mustn't rely on being able to provide more than 400 bytes
221 (7) A function to check the auxiliary data [optional].
223 This function will be called to check that a match found in the cache for
225 data against the data version number returned by the server to determine
237 This function can also be used to extract data from the auxiliary data in
240 (8) A pair of functions to manage contexts for the completion callback
244 to the I/O completion callback function. To ensure this context remains
246 provided: one to get an extra reference on the context, and one to drop a
247 reference to it.
254 (9) A function to mark a page as retaining cache metadata [optional].
256 This is called by the cache to indicate that it is retaining in-memory
266 (10) A function to unmark all the pages retaining cache metadata [mandatory].
268 This is called by FS-Cache to indicate that a backing store is being
270 cleared to prevent confusion. Note that the cache will have torn down all
271 its tracking information so that the pages don't need to be explicitly
281 The first step is to declare the network filesystem to the cache. This also
289 It just takes a pointer to the netfs definition. It returns 0 or an error as
306 subtrees to be bound to particular caches, the second step is to look up cache
307 representation tags. This step is optional; it can be left entirely up to
308 FS-Cache as to which cache should be used. The problem with doing that is that
319 Any representation so obtained must be released by passing it to this function:
331 The third step is to inform FS-Cache about part of an index hierarchy that can
332 be used to locate files. This is done by requesting a cookie for each index in
333 the path to the file:
342 filling in the index entry by calling the operations pointed to by def.
345 internally. It may, however, return NULL to indicate no cookie. It is quite
346 acceptable to pass this token back to this function as the parent to another
347 acquisition (or even to the relinquish cookie, read page and write page
351 object needs to be created somewhere down the hierarchy. Furthermore, an index
356 must be enabled to do anything with it. A disabled cookie can be enabled by
359 For example, with AFS, a cell would be added to the primary index. This index
377 And then a particular flavour of volume (R/O for example) could be added to
390 The fourth step is to request a data file be created in the cache. This is
391 identical to index cookie acquisition. The only difference is that the type in
404 An optional step is to request an object of miscellaneous type be created in
405 the cache. This is almost identical to index cookie acquisition. The only
415 Miscellaneous objects might be used to store extended attributes or directory
423 The fifth step is to set the physical attributes of the file, such as its size.
425 cache to adjust its metadata for data tracking appropriately:
430 space to allocate any extra metadata required in the cache. The attributes
433 Note that attempts to read or write data pages in the cache over this size may
436 This operation schedules an attribute adjustment to happen asynchronously at
438 to the caller. The attribute adjustment excludes read and write operations.
445 And the sixth step is to store and retrieve pages in the cache. There are
446 three functions that are used to do this.
455 (3) A page should only be written to the cache if previous read or allocated.
457 This permits the cache to maintain its page tracking in proper order.
463 Firstly, the netfs should ask FS-Cache to examine the caches and read the
465 allocate space to store the contents if not:
479 the page specified will have the data loaded into it (and is also used to
480 specify the page number), and the gfp argument is used to control how any
491 (2) The function will submit a request to read the data from the cache's
502 (*) The context argument passed to the above function. This will be
508 data. fscache_readpages_cancel() may need to be called.
515 to store the page:
519 (2) A block may be reserved in the cache and attached to the object at the
531 Alternatively, if there's not expected to be any data in the cache for a page
538 This is similar to the fscache_read_or_alloc_page() function, except that it
541 before writing to the cache.
550 Secondly, if the netfs changes the contents of the page (either due to an
552 written back to the cache:
559 contain the data to be written (and is also used to specify the page number),
560 and the gfp argument is used to control how any memory allocations made are
570 Else if space can be allocated in the cache to hold this page:
574 (2) The function will submit a request to write the data to cache's backing
583 is also possible for the PG_fscache_write bit to be cleared when no write took
592 A facility is provided to read several pages at once, as requested by the
603 This works in a similar way to fscache_read_or_alloc_page(), except:
606 dispatched for reading to the disk. Reads of adjacent pages on disk may
635 If one or more pages are passed to fscache_read_or_alloc_pages() but not then
637 those pages will need to have any marks and reservations removed. This can be
643 prior to returning to the caller. The cookie argument should be as passed to
657 This function permits the cache to release any in-memory representation it
659 each page on which the read or write page functions above have been called to
672 to see if a page is being written to the cache, and:
677 to wait for it to finish if it is.
680 When releasepage() is being implemented, a special FS-Cache function exists to
681 manage the heuristics of coping with vmscan trying to eject pages, which may
682 conflict with the cache trying to write pages to the cache (which may itself
683 need to allocate memory):
689 This takes the netfs cookie, and the page and gfp arguments as supplied to
695 storage request to complete, or it may attempt to cancel the storage request -
702 A convenience routine is provided to perform an uncache on all the pages
703 attached to an inode. This assumes that the pages on the inode correspond on a
710 the pages are attached to. This function will wait for pages to finish being
711 written to the cache and for the cache to finish with the page generally. No
719 To find out whether auxiliary data for an object is up to data within the
724 This will call back to the netfs to check whether the auxiliary data associated
733 This function will refer back to the netfs_data pointer stored in the cookie by
734 the acquisition function to obtain the data to write into each revised index
735 entry. The update method in the parent index definition will be called to
739 data blocks are added to a data file object.
747 disabled, it ignores all attempts to acquire child cookies; check, update or
749 still possible to uncache pages and relinquish the cookie.
763 calling fscache_uncache_all_inode_pages() afterwards to make sure all page
777 ruling as to whether or not enablement should actually be permitted to begin.
787 There are a number of operations that can be used to control cookies:
794 These operations permit data cookies to be pinned into the cache and to
799 -ENOSPC if there isn't enough space to honour the operation, -ENOMEM or
806 This permits a netfs to request cache space be reserved to store up to the
807 given amount of a file. It is permitted to ask for more than the current
808 size of the file to allow for future file expansion.
814 -ENOSPC if there isn't enough space to honour the operation, -ENOMEM or
817 Note that this doesn't pin an object in a cache; it can still be culled to
847 There is no direct way to invalidate an index subtree. To do this, the caller
855 Sometimes it will be necessary to invalidate an object that contains data.
857 change - at which point the netfs has to throw away all the state it had for an
865 This can be called with spinlocks held as it defers the work to a thread pool.
868 cache has had a chance to insert a barrier in the operations queue. After
875 to have reached a point at which it can start submitting ordinary operations
888 PG_fscache is used to indicate that the page is known by the cache, and that
889 the cache must be informed if the page is going to go away. It's an indication
890 to the netfs that the cache has an interest in this page, where an interest may
891 be a pointer to it, resources allocated or reserved for it, or I/O in progress
894 The netfs can use this information in methods such as releasepage() to
895 determine whether it needs to uncache a page or update it.
898 will be called on a page to get rid of it, even if PG_private is not set. This
899 allows caching to attempted on a page before read_cache_pages() to be called