Commit 0e822145 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Jonathan Corbet

docs: filesystems: caching/backend-api.txt: convert it to ReST

- Add a SPDX header;
- Adjust document and section titles;
- Some whitespace fixes and new line breaks;
- Mark literal blocks as such;
- Add table markups;
- Add it to filesystems/caching/index.rst.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5d0a61abaa87bfe913b9e2f321e74ef7af0f3dfc.1588021877.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent d74802ad
========================== .. SPDX-License-Identifier: GPL-2.0
FS-CACHE CACHE BACKEND API
========================== ==========================
FS-Cache Cache backend API
==========================
The FS-Cache system provides an API by which actual caches can be supplied to The FS-Cache system provides an API by which actual caches can be supplied to
FS-Cache for it to then serve out to network filesystems and other interested FS-Cache for it to then serve out to network filesystems and other interested
...@@ -9,15 +11,14 @@ parties. ...@@ -9,15 +11,14 @@ parties.
This API is declared in <linux/fscache-cache.h>. This API is declared in <linux/fscache-cache.h>.
==================================== Initialising and Registering a Cache
INITIALISING AND REGISTERING A CACHE
==================================== ====================================
To start off, a cache definition must be initialised and registered for each To start off, a cache definition must be initialised and registered for each
cache the backend wants to make available. For instance, CacheFS does this in cache the backend wants to make available. For instance, CacheFS does this in
the fill_super() operation on mounting. the fill_super() operation on mounting.
The cache definition (struct fscache_cache) should be initialised by calling: The cache definition (struct fscache_cache) should be initialised by calling::
void fscache_init_cache(struct fscache_cache *cache, void fscache_init_cache(struct fscache_cache *cache,
struct fscache_cache_ops *ops, struct fscache_cache_ops *ops,
...@@ -26,17 +27,17 @@ The cache definition (struct fscache_cache) should be initialised by calling: ...@@ -26,17 +27,17 @@ The cache definition (struct fscache_cache) should be initialised by calling:
Where: Where:
(*) "cache" is a pointer to the cache definition; * "cache" is a pointer to the cache definition;
(*) "ops" is a pointer to the table of operations that the backend supports on * "ops" is a pointer to the table of operations that the backend supports on
this cache; and this cache; and
(*) "idfmt" is a format and printf-style arguments for constructing a label * "idfmt" is a format and printf-style arguments for constructing a label
for the cache. for the cache.
The cache should then be registered with FS-Cache by passing a pointer to the The cache should then be registered with FS-Cache by passing a pointer to the
previously initialised cache definition to: previously initialised cache definition to::
int fscache_add_cache(struct fscache_cache *cache, int fscache_add_cache(struct fscache_cache *cache,
struct fscache_object *fsdef, struct fscache_object *fsdef,
...@@ -44,12 +45,12 @@ previously initialised cache definition to: ...@@ -44,12 +45,12 @@ previously initialised cache definition to:
Two extra arguments should also be supplied: Two extra arguments should also be supplied:
(*) "fsdef" which should point to the object representation for the FS-Cache * "fsdef" which should point to the object representation for the FS-Cache
master index in this cache. Netfs primary index entries will be created master index in this cache. Netfs primary index entries will be created
here. FS-Cache keeps the caller's reference to the index object if here. FS-Cache keeps the caller's reference to the index object if
successful and will release it upon withdrawal of the cache. successful and will release it upon withdrawal of the cache.
(*) "tagname" which, if given, should be a text string naming this cache. If * "tagname" which, if given, should be a text string naming this cache. If
this is NULL, the identifier will be used instead. For CacheFS, the this is NULL, the identifier will be used instead. For CacheFS, the
identifier is set to name the underlying block device and the tag can be identifier is set to name the underlying block device and the tag can be
supplied by mount. supplied by mount.
...@@ -58,20 +59,18 @@ This function may return -ENOMEM if it ran out of memory or -EEXIST if the tag ...@@ -58,20 +59,18 @@ This function may return -ENOMEM if it ran out of memory or -EEXIST if the tag
is already in use. 0 will be returned on success. is already in use. 0 will be returned on success.
===================== Unregistering a Cache
UNREGISTERING A CACHE
===================== =====================
A cache can be withdrawn from the system by calling this function with a A cache can be withdrawn from the system by calling this function with a
pointer to the cache definition: pointer to the cache definition::
void fscache_withdraw_cache(struct fscache_cache *cache); void fscache_withdraw_cache(struct fscache_cache *cache);
In CacheFS's case, this is called by put_super(). In CacheFS's case, this is called by put_super().
======== Security
SECURITY
======== ========
The cache methods are executed one of two contexts: The cache methods are executed one of two contexts:
...@@ -89,8 +88,7 @@ be masqueraded for the duration of the cache driver's access to the cache. ...@@ -89,8 +88,7 @@ be masqueraded for the duration of the cache driver's access to the cache.
This is left to the cache to handle; FS-Cache makes no effort in this regard. This is left to the cache to handle; FS-Cache makes no effort in this regard.
=================================== Control and Statistics Presentation
CONTROL AND STATISTICS PRESENTATION
=================================== ===================================
The cache may present data to the outside world through FS-Cache's interfaces The cache may present data to the outside world through FS-Cache's interfaces
...@@ -101,11 +99,10 @@ is enabled. This is accessible through the kobject struct fscache_cache::kobj ...@@ -101,11 +99,10 @@ is enabled. This is accessible through the kobject struct fscache_cache::kobj
and is for use by the cache as it sees fit. and is for use by the cache as it sees fit.
======================== Relevant Data Structures
RELEVANT DATA STRUCTURES
======================== ========================
(*) Index/Data file FS-Cache representation cookie: * Index/Data file FS-Cache representation cookie::
struct fscache_cookie { struct fscache_cookie {
struct fscache_object_def *def; struct fscache_object_def *def;
...@@ -121,7 +118,7 @@ RELEVANT DATA STRUCTURES ...@@ -121,7 +118,7 @@ RELEVANT DATA STRUCTURES
cache operations. cache operations.
(*) In-cache object representation: * In-cache object representation::
struct fscache_object { struct fscache_object {
int debug_id; int debug_id;
...@@ -150,7 +147,7 @@ RELEVANT DATA STRUCTURES ...@@ -150,7 +147,7 @@ RELEVANT DATA STRUCTURES
initialised by calling fscache_object_init(object). initialised by calling fscache_object_init(object).
(*) FS-Cache operation record: * FS-Cache operation record::
struct fscache_operation { struct fscache_operation {
atomic_t usage; atomic_t usage;
...@@ -173,7 +170,7 @@ RELEVANT DATA STRUCTURES ...@@ -173,7 +170,7 @@ RELEVANT DATA STRUCTURES
an operation needs more processing time, it should be enqueued again. an operation needs more processing time, it should be enqueued again.
(*) FS-Cache retrieval operation record: * FS-Cache retrieval operation record::
struct fscache_retrieval { struct fscache_retrieval {
struct fscache_operation op; struct fscache_operation op;
...@@ -198,7 +195,7 @@ RELEVANT DATA STRUCTURES ...@@ -198,7 +195,7 @@ RELEVANT DATA STRUCTURES
it sees fit. it sees fit.
(*) FS-Cache storage operation record: * FS-Cache storage operation record::
struct fscache_storage { struct fscache_storage {
struct fscache_operation op; struct fscache_operation op;
...@@ -212,16 +209,17 @@ RELEVANT DATA STRUCTURES ...@@ -212,16 +209,17 @@ RELEVANT DATA STRUCTURES
storage. storage.
================ Cache Operations
CACHE OPERATIONS
================ ================
The cache backend provides FS-Cache with a table of operations that can be The cache backend provides FS-Cache with a table of operations that can be
performed on the denizens of the cache. These are held in a structure of type: performed on the denizens of the cache. These are held in a structure of type:
::
struct fscache_cache_ops struct fscache_cache_ops
(*) Name of cache provider [mandatory]: * Name of cache provider [mandatory]::
const char *name const char *name
...@@ -229,7 +227,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -229,7 +227,7 @@ performed on the denizens of the cache. These are held in a structure of type:
the backend. the backend.
(*) Allocate a new object [mandatory]: * Allocate a new object [mandatory]::
struct fscache_object *(*alloc_object)(struct fscache_cache *cache, struct fscache_object *(*alloc_object)(struct fscache_cache *cache,
struct fscache_cookie *cookie) struct fscache_cookie *cookie)
...@@ -244,7 +242,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -244,7 +242,7 @@ performed on the denizens of the cache. These are held in a structure of type:
form once lookup is complete or aborted. form once lookup is complete or aborted.
(*) Look up and create object [mandatory]: * Look up and create object [mandatory]::
void (*lookup_object)(struct fscache_object *object) void (*lookup_object)(struct fscache_object *object)
...@@ -263,7 +261,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -263,7 +261,7 @@ performed on the denizens of the cache. These are held in a structure of type:
to abort the lookup of that object. to abort the lookup of that object.
(*) Release lookup data [mandatory]: * Release lookup data [mandatory]::
void (*lookup_complete)(struct fscache_object *object) void (*lookup_complete)(struct fscache_object *object)
...@@ -271,7 +269,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -271,7 +269,7 @@ performed on the denizens of the cache. These are held in a structure of type:
using to perform a lookup. using to perform a lookup.
(*) Increment object refcount [mandatory]: * Increment object refcount [mandatory]::
struct fscache_object *(*grab_object)(struct fscache_object *object) struct fscache_object *(*grab_object)(struct fscache_object *object)
...@@ -280,7 +278,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -280,7 +278,7 @@ performed on the denizens of the cache. These are held in a structure of type:
It should return the object pointer if successful. It should return the object pointer if successful.
(*) Lock/Unlock object [mandatory]: * Lock/Unlock object [mandatory]::
void (*lock_object)(struct fscache_object *object) void (*lock_object)(struct fscache_object *object)
void (*unlock_object)(struct fscache_object *object) void (*unlock_object)(struct fscache_object *object)
...@@ -289,7 +287,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -289,7 +287,7 @@ performed on the denizens of the cache. These are held in a structure of type:
to schedule with the lock held, so a spinlock isn't sufficient. to schedule with the lock held, so a spinlock isn't sufficient.
(*) Pin/Unpin object [optional]: * Pin/Unpin object [optional]::
int (*pin_object)(struct fscache_object *object) int (*pin_object)(struct fscache_object *object)
void (*unpin_object)(struct fscache_object *object) void (*unpin_object)(struct fscache_object *object)
...@@ -299,7 +297,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -299,7 +297,7 @@ performed on the denizens of the cache. These are held in a structure of type:
enough space in the cache to permit this. enough space in the cache to permit this.
(*) Check coherency state of an object [mandatory]: * Check coherency state of an object [mandatory]::
int (*check_consistency)(struct fscache_object *object) int (*check_consistency)(struct fscache_object *object)
...@@ -308,7 +306,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -308,7 +306,7 @@ performed on the denizens of the cache. These are held in a structure of type:
if they're consistent and -ESTALE otherwise. -ENOMEM and -ERESTARTSYS if they're consistent and -ESTALE otherwise. -ENOMEM and -ERESTARTSYS
may also be returned. may also be returned.
(*) Update object [mandatory]: * Update object [mandatory]::
int (*update_object)(struct fscache_object *object) int (*update_object)(struct fscache_object *object)
...@@ -317,7 +315,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -317,7 +315,7 @@ performed on the denizens of the cache. These are held in a structure of type:
obtained by calling object->cookie->def->get_aux()/get_attr(). obtained by calling object->cookie->def->get_aux()/get_attr().
(*) Invalidate data object [mandatory]: * Invalidate data object [mandatory]::
int (*invalidate_object)(struct fscache_operation *op) int (*invalidate_object)(struct fscache_operation *op)
...@@ -329,7 +327,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -329,7 +327,7 @@ performed on the denizens of the cache. These are held in a structure of type:
fscache_op_complete() must be called on op before returning. fscache_op_complete() must be called on op before returning.
(*) Discard object [mandatory]: * Discard object [mandatory]::
void (*drop_object)(struct fscache_object *object) void (*drop_object)(struct fscache_object *object)
...@@ -341,7 +339,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -341,7 +339,7 @@ performed on the denizens of the cache. These are held in a structure of type:
caller. The caller will invoke the put_object() method as appropriate. caller. The caller will invoke the put_object() method as appropriate.
(*) Release object reference [mandatory]: * Release object reference [mandatory]::
void (*put_object)(struct fscache_object *object) void (*put_object)(struct fscache_object *object)
...@@ -349,7 +347,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -349,7 +347,7 @@ performed on the denizens of the cache. These are held in a structure of type:
be freed when all the references to it are released. be freed when all the references to it are released.
(*) Synchronise a cache [mandatory]: * Synchronise a cache [mandatory]::
void (*sync)(struct fscache_cache *cache) void (*sync)(struct fscache_cache *cache)
...@@ -357,7 +355,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -357,7 +355,7 @@ performed on the denizens of the cache. These are held in a structure of type:
device. device.
(*) Dissociate a cache [mandatory]: * Dissociate a cache [mandatory]::
void (*dissociate_pages)(struct fscache_cache *cache) void (*dissociate_pages)(struct fscache_cache *cache)
...@@ -365,7 +363,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -365,7 +363,7 @@ performed on the denizens of the cache. These are held in a structure of type:
cache withdrawal. cache withdrawal.
(*) Notification that the attributes on a netfs file changed [mandatory]: * Notification that the attributes on a netfs file changed [mandatory]::
int (*attr_changed)(struct fscache_object *object); int (*attr_changed)(struct fscache_object *object);
...@@ -386,7 +384,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -386,7 +384,7 @@ performed on the denizens of the cache. These are held in a structure of type:
execution of this operation. execution of this operation.
(*) Reserve cache space for an object's data [optional]: * Reserve cache space for an object's data [optional]::
int (*reserve_space)(struct fscache_object *object, loff_t size); int (*reserve_space)(struct fscache_object *object, loff_t size);
...@@ -404,7 +402,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -404,7 +402,7 @@ performed on the denizens of the cache. These are held in a structure of type:
size if larger than that already. size if larger than that already.
(*) Request page be read from cache [mandatory]: * Request page be read from cache [mandatory]::
int (*read_or_alloc_page)(struct fscache_retrieval *op, int (*read_or_alloc_page)(struct fscache_retrieval *op,
struct page *page, struct page *page,
...@@ -446,7 +444,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -446,7 +444,7 @@ performed on the denizens of the cache. These are held in a structure of type:
with. This will complete the operation when all pages are dealt with. with. This will complete the operation when all pages are dealt with.
(*) Request pages be read from cache [mandatory]: * Request pages be read from cache [mandatory]::
int (*read_or_alloc_pages)(struct fscache_retrieval *op, int (*read_or_alloc_pages)(struct fscache_retrieval *op,
struct list_head *pages, struct list_head *pages,
...@@ -457,7 +455,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -457,7 +455,7 @@ performed on the denizens of the cache. These are held in a structure of type:
of pages instead of one page. Any pages on which a read operation is of pages instead of one page. Any pages on which a read operation is
started must be added to the page cache for the specified mapping and also started must be added to the page cache for the specified mapping and also
to the LRU. Such pages must also be removed from the pages list and to the LRU. Such pages must also be removed from the pages list and
*nr_pages decremented per page. ``*nr_pages`` decremented per page.
If there was an error such as -ENOMEM, then that should be returned; else If there was an error such as -ENOMEM, then that should be returned; else
if one or more pages couldn't be read or allocated, then -ENOBUFS should if one or more pages couldn't be read or allocated, then -ENOBUFS should
...@@ -466,7 +464,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -466,7 +464,7 @@ performed on the denizens of the cache. These are held in a structure of type:
returned. returned.
(*) Request page be allocated in the cache [mandatory]: * Request page be allocated in the cache [mandatory]::
int (*allocate_page)(struct fscache_retrieval *op, int (*allocate_page)(struct fscache_retrieval *op,
struct page *page, struct page *page,
...@@ -482,7 +480,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -482,7 +480,7 @@ performed on the denizens of the cache. These are held in a structure of type:
allocated, then the netfs page should be marked and 0 returned. allocated, then the netfs page should be marked and 0 returned.
(*) Request pages be allocated in the cache [mandatory]: * Request pages be allocated in the cache [mandatory]::
int (*allocate_pages)(struct fscache_retrieval *op, int (*allocate_pages)(struct fscache_retrieval *op,
struct list_head *pages, struct list_head *pages,
...@@ -493,7 +491,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -493,7 +491,7 @@ performed on the denizens of the cache. These are held in a structure of type:
nr_pages should be treated as for the read_or_alloc_pages() method. nr_pages should be treated as for the read_or_alloc_pages() method.
(*) Request page be written to cache [mandatory]: * Request page be written to cache [mandatory]::
int (*write_page)(struct fscache_storage *op, int (*write_page)(struct fscache_storage *op,
struct page *page); struct page *page);
...@@ -514,7 +512,7 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -514,7 +512,7 @@ performed on the denizens of the cache. These are held in a structure of type:
appropriately. appropriately.
(*) Discard retained per-page metadata [mandatory]: * Discard retained per-page metadata [mandatory]::
void (*uncache_page)(struct fscache_object *object, struct page *page) void (*uncache_page)(struct fscache_object *object, struct page *page)
...@@ -523,13 +521,12 @@ performed on the denizens of the cache. These are held in a structure of type: ...@@ -523,13 +521,12 @@ performed on the denizens of the cache. These are held in a structure of type:
maintains for this page. maintains for this page.
================== FS-Cache Utilities
FS-CACHE UTILITIES
================== ==================
FS-Cache provides some utilities that a cache backend may make use of: FS-Cache provides some utilities that a cache backend may make use of:
(*) Note occurrence of an I/O error in a cache: * Note occurrence of an I/O error in a cache::
void fscache_io_error(struct fscache_cache *cache) void fscache_io_error(struct fscache_cache *cache)
...@@ -541,7 +538,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -541,7 +538,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
This does not actually withdraw the cache. That must be done separately. This does not actually withdraw the cache. That must be done separately.
(*) Invoke the retrieval I/O completion function: * Invoke the retrieval I/O completion function::
void fscache_end_io(struct fscache_retrieval *op, struct page *page, void fscache_end_io(struct fscache_retrieval *op, struct page *page,
int error); int error);
...@@ -550,8 +547,8 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -550,8 +547,8 @@ FS-Cache provides some utilities that a cache backend may make use of:
error value should be 0 if successful and an error otherwise. error value should be 0 if successful and an error otherwise.
(*) Record that one or more pages being retrieved or allocated have been dealt * Record that one or more pages being retrieved or allocated have been dealt
with: with::
void fscache_retrieval_complete(struct fscache_retrieval *op, void fscache_retrieval_complete(struct fscache_retrieval *op,
int n_pages); int n_pages);
...@@ -562,7 +559,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -562,7 +559,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
completed. completed.
(*) Record operation completion: * Record operation completion::
void fscache_op_complete(struct fscache_operation *op); void fscache_op_complete(struct fscache_operation *op);
...@@ -571,7 +568,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -571,7 +568,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
one or more pending operations to start running. one or more pending operations to start running.
(*) Set highest store limit: * Set highest store limit::
void fscache_set_store_limit(struct fscache_object *object, void fscache_set_store_limit(struct fscache_object *object,
loff_t i_size); loff_t i_size);
...@@ -581,7 +578,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -581,7 +578,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
rejected by fscache_read_alloc_page() and co with -ENOBUFS. rejected by fscache_read_alloc_page() and co with -ENOBUFS.
(*) Mark pages as being cached: * Mark pages as being cached::
void fscache_mark_pages_cached(struct fscache_retrieval *op, void fscache_mark_pages_cached(struct fscache_retrieval *op,
struct pagevec *pagevec); struct pagevec *pagevec);
...@@ -590,7 +587,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -590,7 +587,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
the netfs must call fscache_uncache_page() to unmark the pages. the netfs must call fscache_uncache_page() to unmark the pages.
(*) Perform coherency check on an object: * Perform coherency check on an object::
enum fscache_checkaux fscache_check_aux(struct fscache_object *object, enum fscache_checkaux fscache_check_aux(struct fscache_object *object,
const void *data, const void *data,
...@@ -603,29 +600,26 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -603,29 +600,26 @@ FS-Cache provides some utilities that a cache backend may make use of:
One of three values will be returned: One of three values will be returned:
(*) FSCACHE_CHECKAUX_OKAY FSCACHE_CHECKAUX_OKAY
The coherency data indicates the object is valid as is. The coherency data indicates the object is valid as is.
(*) FSCACHE_CHECKAUX_NEEDS_UPDATE FSCACHE_CHECKAUX_NEEDS_UPDATE
The coherency data needs updating, but otherwise the object is The coherency data needs updating, but otherwise the object is
valid. valid.
(*) FSCACHE_CHECKAUX_OBSOLETE FSCACHE_CHECKAUX_OBSOLETE
The coherency data indicates that the object is obsolete and should The coherency data indicates that the object is obsolete and should
be discarded. be discarded.
(*) Initialise a freshly allocated object: * Initialise a freshly allocated object::
void fscache_object_init(struct fscache_object *object); void fscache_object_init(struct fscache_object *object);
This initialises all the fields in an object representation. This initialises all the fields in an object representation.
(*) Indicate the destruction of an object: * Indicate the destruction of an object::
void fscache_object_destroyed(struct fscache_cache *cache); void fscache_object_destroyed(struct fscache_cache *cache);
...@@ -635,7 +629,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -635,7 +629,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
all the objects. all the objects.
(*) Indicate negative lookup on an object: * Indicate negative lookup on an object::
void fscache_object_lookup_negative(struct fscache_object *object); void fscache_object_lookup_negative(struct fscache_object *object);
...@@ -650,7 +644,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -650,7 +644,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
significant - all subsequent calls are ignored. significant - all subsequent calls are ignored.
(*) Indicate an object has been obtained: * Indicate an object has been obtained::
void fscache_obtained_object(struct fscache_object *object); void fscache_obtained_object(struct fscache_object *object);
...@@ -667,7 +661,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -667,7 +661,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
(2) that writes may now proceed against this object. (2) that writes may now proceed against this object.
(*) Indicate that object lookup failed: * Indicate that object lookup failed::
void fscache_object_lookup_error(struct fscache_object *object); void fscache_object_lookup_error(struct fscache_object *object);
...@@ -676,7 +670,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -676,7 +670,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
as possible. as possible.
(*) Indicate that a stale object was found and discarded: * Indicate that a stale object was found and discarded::
void fscache_object_retrying_stale(struct fscache_object *object); void fscache_object_retrying_stale(struct fscache_object *object);
...@@ -685,7 +679,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -685,7 +679,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
discarded from the cache and the lookup will be performed again. discarded from the cache and the lookup will be performed again.
(*) Indicate that the caching backend killed an object: * Indicate that the caching backend killed an object::
void fscache_object_mark_killed(struct fscache_object *object, void fscache_object_mark_killed(struct fscache_object *object,
enum fscache_why_object_killed why); enum fscache_why_object_killed why);
...@@ -693,13 +687,20 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -693,13 +687,20 @@ FS-Cache provides some utilities that a cache backend may make use of:
This is called to indicate that the cache backend preemptively killed an This is called to indicate that the cache backend preemptively killed an
object. The why parameter should be set to indicate the reason: object. The why parameter should be set to indicate the reason:
FSCACHE_OBJECT_IS_STALE - the object was stale and needs discarding. FSCACHE_OBJECT_IS_STALE
FSCACHE_OBJECT_NO_SPACE - there was insufficient cache space - the object was stale and needs discarding.
FSCACHE_OBJECT_WAS_RETIRED - the object was retired when relinquished.
FSCACHE_OBJECT_WAS_CULLED - the object was culled to make space. FSCACHE_OBJECT_NO_SPACE
- there was insufficient cache space
FSCACHE_OBJECT_WAS_RETIRED
- the object was retired when relinquished.
FSCACHE_OBJECT_WAS_CULLED
- the object was culled to make space.
(*) Get and release references on a retrieval record: * Get and release references on a retrieval record::
void fscache_get_retrieval(struct fscache_retrieval *op); void fscache_get_retrieval(struct fscache_retrieval *op);
void fscache_put_retrieval(struct fscache_retrieval *op); void fscache_put_retrieval(struct fscache_retrieval *op);
...@@ -708,7 +709,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -708,7 +709,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
asynchronous data retrieval and block allocation. asynchronous data retrieval and block allocation.
(*) Enqueue a retrieval record for processing. * Enqueue a retrieval record for processing::
void fscache_enqueue_retrieval(struct fscache_retrieval *op); void fscache_enqueue_retrieval(struct fscache_retrieval *op);
...@@ -718,7 +719,7 @@ FS-Cache provides some utilities that a cache backend may make use of: ...@@ -718,7 +719,7 @@ FS-Cache provides some utilities that a cache backend may make use of:
within the callback function. within the callback function.
(*) List of object state names: * List of object state names::
const char *fscache_object_states[]; const char *fscache_object_states[];
......
...@@ -187,7 +187,7 @@ The netfs API to FS-Cache can be found in: ...@@ -187,7 +187,7 @@ The netfs API to FS-Cache can be found in:
The cache backend API to FS-Cache can be found in: The cache backend API to FS-Cache can be found in:
Documentation/filesystems/caching/backend-api.txt Documentation/filesystems/caching/backend-api.rst
A description of the internal representations and object state machine can be A description of the internal representations and object state machine can be
found in: found in:
......
...@@ -8,6 +8,7 @@ Filesystem Caching ...@@ -8,6 +8,7 @@ Filesystem Caching
fscache fscache
object object
backend-api
cachefiles cachefiles
netfs-api netfs-api
operations operations
...@@ -172,7 +172,7 @@ struct fscache_cache *fscache_select_cache_for_object( ...@@ -172,7 +172,7 @@ struct fscache_cache *fscache_select_cache_for_object(
* *
* Initialise a record of a cache and fill in the name. * Initialise a record of a cache and fill in the name.
* *
* See Documentation/filesystems/caching/backend-api.txt for a complete * See Documentation/filesystems/caching/backend-api.rst for a complete
* description. * description.
*/ */
void fscache_init_cache(struct fscache_cache *cache, void fscache_init_cache(struct fscache_cache *cache,
...@@ -207,7 +207,7 @@ EXPORT_SYMBOL(fscache_init_cache); ...@@ -207,7 +207,7 @@ EXPORT_SYMBOL(fscache_init_cache);
* *
* Add a cache to the system, making it available for netfs's to use. * Add a cache to the system, making it available for netfs's to use.
* *
* See Documentation/filesystems/caching/backend-api.txt for a complete * See Documentation/filesystems/caching/backend-api.rst for a complete
* description. * description.
*/ */
int fscache_add_cache(struct fscache_cache *cache, int fscache_add_cache(struct fscache_cache *cache,
...@@ -307,7 +307,7 @@ EXPORT_SYMBOL(fscache_add_cache); ...@@ -307,7 +307,7 @@ EXPORT_SYMBOL(fscache_add_cache);
* Note that an I/O error occurred in a cache and that it should no longer be * Note that an I/O error occurred in a cache and that it should no longer be
* used for anything. This also reports the error into the kernel log. * used for anything. This also reports the error into the kernel log.
* *
* See Documentation/filesystems/caching/backend-api.txt for a complete * See Documentation/filesystems/caching/backend-api.rst for a complete
* description. * description.
*/ */
void fscache_io_error(struct fscache_cache *cache) void fscache_io_error(struct fscache_cache *cache)
...@@ -355,7 +355,7 @@ static void fscache_withdraw_all_objects(struct fscache_cache *cache, ...@@ -355,7 +355,7 @@ static void fscache_withdraw_all_objects(struct fscache_cache *cache,
* Withdraw a cache from service, unbinding all its cache objects from the * Withdraw a cache from service, unbinding all its cache objects from the
* netfs cookies they're currently representing. * netfs cookies they're currently representing.
* *
* See Documentation/filesystems/caching/backend-api.txt for a complete * See Documentation/filesystems/caching/backend-api.rst for a complete
* description. * description.
*/ */
void fscache_withdraw_cache(struct fscache_cache *cache) void fscache_withdraw_cache(struct fscache_cache *cache)
......
...@@ -295,7 +295,7 @@ static void fscache_object_work_func(struct work_struct *work) ...@@ -295,7 +295,7 @@ static void fscache_object_work_func(struct work_struct *work)
* *
* Initialise a cache object description to its basic values. * Initialise a cache object description to its basic values.
* *
* See Documentation/filesystems/caching/backend-api.txt for a complete * See Documentation/filesystems/caching/backend-api.rst for a complete
* description. * description.
*/ */
void fscache_object_init(struct fscache_object *object, void fscache_object_init(struct fscache_object *object,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* NOTE!!! See: * NOTE!!! See:
* *
* Documentation/filesystems/caching/backend-api.txt * Documentation/filesystems/caching/backend-api.rst
* *
* for a description of the cache backend interface declared here. * for a description of the cache backend interface declared here.
*/ */
...@@ -454,7 +454,7 @@ static inline void fscache_object_lookup_error(struct fscache_object *object) ...@@ -454,7 +454,7 @@ static inline void fscache_object_lookup_error(struct fscache_object *object)
* Set the maximum size an object is permitted to reach, implying the highest * Set the maximum size an object is permitted to reach, implying the highest
* byte that may be written. Intended to be called by the attr_changed() op. * byte that may be written. Intended to be called by the attr_changed() op.
* *
* See Documentation/filesystems/caching/backend-api.txt for a complete * See Documentation/filesystems/caching/backend-api.rst for a complete
* description. * description.
*/ */
static inline static inline
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment