diff options
author | David Howells <dhowells@redhat.com> | 2013-08-21 17:29:38 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2013-09-06 04:17:30 -0400 |
commit | da9803bc8812f5bd3b26baaa90e515b843c65ff7 (patch) | |
tree | 889b39ec88863fb46606cf345eeb4fdf8a90a67e /Documentation/filesystems/caching/backend-api.txt | |
parent | 6e4664525b1db28f8c4e1130957f70a94c19213e (diff) |
FS-Cache: Add interface to check consistency of a cached object
Extend the fscache netfs API so that the netfs can ask as to whether a cache
object is up to date with respect to its corresponding netfs object:
int fscache_check_consistency(struct fscache_cookie *cookie)
This will call back to the netfs to check whether the auxiliary data associated
with a cookie is correct. It returns 0 if it is and -ESTALE if it isn't; it
may also return -ENOMEM and -ERESTARTSYS.
The backends now have to implement a mandatory operation pointer:
int (*check_consistency)(struct fscache_object *object)
that corresponds to the above API call. FS-Cache takes care of pinning the
object and the cookie in memory and managing this call with respect to the
object state.
Original-author: Hongyi Jia <jiayisuse@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Hongyi Jia <jiayisuse@gmail.com>
cc: Milosz Tanski <milosz@adfin.com>
Diffstat (limited to 'Documentation/filesystems/caching/backend-api.txt')
-rw-r--r-- | Documentation/filesystems/caching/backend-api.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/filesystems/caching/backend-api.txt b/Documentation/filesystems/caching/backend-api.txt index d78bab9622c6..277d1e810670 100644 --- a/Documentation/filesystems/caching/backend-api.txt +++ b/Documentation/filesystems/caching/backend-api.txt | |||
@@ -299,6 +299,15 @@ performed on the denizens of the cache. These are held in a structure of type: | |||
299 | enough space in the cache to permit this. | 299 | enough space in the cache to permit this. |
300 | 300 | ||
301 | 301 | ||
302 | (*) Check coherency state of an object [mandatory]: | ||
303 | |||
304 | int (*check_consistency)(struct fscache_object *object) | ||
305 | |||
306 | This method is called to have the cache check the saved auxiliary data of | ||
307 | the object against the netfs's idea of the state. 0 should be returned | ||
308 | if they're consistent and -ESTALE otherwise. -ENOMEM and -ERESTARTSYS | ||
309 | may also be returned. | ||
310 | |||
302 | (*) Update object [mandatory]: | 311 | (*) Update object [mandatory]: |
303 | 312 | ||
304 | int (*update_object)(struct fscache_object *object) | 313 | int (*update_object)(struct fscache_object *object) |