Lines Matching refs:be
58 This first two fields should be filled in before registration, and the third
59 will be filled in by the registration function; any other fields should just be
67 entire in-cache hierarchy for this netfs will be scrapped and begun
70 (3) The cookie representing the primary index will be allocated according to
105 (1) Any index containing non-index objects should be restricted to a single
106 cache. Any such objects created within an index will be created in the
107 first cache only. The cache in which an index is created can be
110 (2) The entry data must be atomically journallable, so it is limited to about
111 400 bytes at present. At least 400 bytes will be available.
113 (3) The depth of the index tree should be judged with care as the search
121 To define an object, a structure of the following type should be filled out:
181 This function is invoked when an index needs to be instantiated in a cache
183 parent for the non-index object will be queried. Any indices above that
184 in the hierarchy may be stored in multiple caches. This function does not
185 need to be supplied for any non-index object or any index that will only
189 cache in the parent's list will be chosen, or failing that, the first
194 This function will be called with the netfs data that was passed to the
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
204 be reserved for this file in the cache.
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.
217 The length of the auxiliary data buffer may be dependent on the key
223 This function will be called to check that a match found in the cache for
228 If this function is absent, it will be assumed that matching objects in a
235 (*) FSCACHE_CHECKAUX_OBSOLETE - the entry should be deleted
237 This function can also be used to extract data from the auxiliary data in
245 valid until after the I/O completion is called, two functions may be
252 be called in interrupt context and so may not sleep.
259 or not. Note that several pages at once may be presented for marking.
261 The PG_fscache bit is set on the pages before this function would be
262 called, so the function need not be provided if this is sufficient.
269 unbound from a cookie and that all the marks on the pages should be
271 its tracking information so that the pages don't need to be explicitly
282 involves specifying the layout of the primary index (for AFS, this would be the
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:
323 The tag will be retrieved by FS-Cache when it calls the object definition
332 be used to locate files. This is done by requesting a cookie for each index in
351 object needs to be created somewhere down the hierarchy. Furthermore, an index
352 may be created in several different caches independently at different times.
355 A cookie will be created in the disabled state if enabled is false. A cookie
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
368 Then when a volume location was accessed, it would be entered into the cell's
369 index and an inode would be allocated that acts as a volume type and hash chain
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
392 the object definition should be something other than index type.
404 An optional step is to request an object of miscellaneous type be created in
406 difference is that the type in the object definition should be something other
407 than index type. Whilst the parent object could be an index, it's more likely
408 it would be some other type of object such as a data file.
415 Miscellaneous objects might be used to store extended attributes or directory
431 will be accessed with the get_attr() cookie definition operation.
434 be rebuffed with -ENOBUFS.
450 (1) A page should not be re-read or re-allocated without uncaching it first.
452 (2) A read or allocated page must be uncached when the netfs page is released
455 (3) A page should only be written to the cache if previous read or allocated.
489 (1) The mark_pages_cached() cookie operation will be called on that page.
496 (4) When the read is complete, end_io_func() will be invoked with:
502 (*) The context argument passed to the above function. This will be
507 If an error occurs, it should be assumed that the page contains no usable
508 data. fscache_readpages_cancel() may need to be called.
510 end_io_func() will be called in process context if the read is results in
511 an error, but it might be called in interrupt context if the read is
514 Otherwise, if there's not a copy available in cache, but the cache may be able
517 (1) The mark_pages_cached() cookie operation will be called on that 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
532 because the file has been extended, a block can simply be allocated instead:
540 rather than -ENODATA as the other would. One or the other must be performed
543 The mark_pages_cached() cookie operation will be called on the page if
551 initial download or if a user performs a write), then the page should be
559 contain the data to be written (and is also used to specify the page number),
570 Else if space can be allocated in the cache to hold this page:
572 (1) PG_fscache_write will be set on the page.
580 anyone waiting for that bit will be woken up.
582 Else if there's no space available in the cache, -ENOBUFS will be returned. It
583 is also possible for the PG_fscache_write bit to be cleared when no write took
607 be merged for greater efficiency.
609 (2) The mark_pages_cached() cookie operation will be called on several pages
612 (3) If there was an general error, then that error will be returned.
614 Else if some pages couldn't be allocated or read, then -ENOBUFS will be
617 Else if some pages couldn't be read but were allocated, then -ENODATA will
618 be returned.
620 Otherwise, if all pages had reads dispatched, then 0 will be returned, the
621 list will be empty and *nr_pages will be 0.
623 (4) end_io_func will be called once for each page being read as the reads
624 complete. It will be called in process context if error != 0, but it may
625 be called in interrupt context if there is no error.
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
644 fscache_read_or_alloc_pages(). Every page in the pages list will be examined
645 and any that have PG_fscache set will be uncached.
652 To uncache a page, this function should be called:
658 might be holding for this netfs page. This function must be called once for
662 Note that pages can't be explicitly deleted from the a data file. The whole
663 data file must be retired (see the relinquish cookie function below).
690 releasepage(). It will return false if the page cannot be released yet for
691 some reason and if it returns true, the page has been uncached and can now be
696 in which case the page will not be stored in the cache this time.
720 cache, the following function can be called:
729 following function should be called:
735 entry. The update method in the parent index definition will be called to
752 can be enabled or disabled later. To disable a cookie, call:
766 Cookies can be enabled or reenabled with:
777 ruling as to whether or not enablement should actually be permitted to begin.
779 All possible failures are handled internally. The cookie will only be marked
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
806 This permits a netfs to request cache space be reserved to store up to the
810 If size is given as zero then the reservation will be cancelled.
817 Note that this doesn't pin an object in a cache; it can still be culled to
825 To get rid of a cookie, this function should be called.
830 If retire is non-zero, then the object will be marked for recycling, and all
831 copies of it will be removed from all active caches in which it is present.
832 Not only that but all child objects will also be retired.
834 If retire is zero, then the object may be available again when next the
838 One very important note - relinquish must NOT be called for a cookie unless all
855 Sometimes it will be necessary to invalidate an object that contains data.
856 Typically this will be necessary when the server tells the netfs of a foreign
860 To indicate that a cache object should be invalidated, the following function
861 can be called:
865 This can be called with spinlocks held as it defers the work to a thread pool.
867 cancelled and discarded. Some future operations will be rejected until the
869 that, operations will be queued again behind the invalidation operation.
889 the cache must be informed if the page is going to go away. It's an indication
891 be a pointer to it, resources allocated or reserved for it, or I/O in progress
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
904 can be used with a filesystem that uses the block buffering code.