]> git.baikalelectronics.ru Git - kernel.git/commit
FS-Cache: Add interface to check consistency of a cached object
authorDavid Howells <dhowells@redhat.com>
Wed, 21 Aug 2013 21:29:38 +0000 (17:29 -0400)
committerDavid Howells <dhowells@redhat.com>
Fri, 6 Sep 2013 08:17:30 +0000 (09:17 +0100)
commitea20e9b4f95c9f6e08df8e320e08e6f0769dd855
tree889b39ec88863fb46606cf345eeb4fdf8a90a67e
parenta0800deb4eb1919a89a8208f633db085e46a905d
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>
Documentation/filesystems/caching/backend-api.txt
Documentation/filesystems/caching/netfs-api.txt
fs/fscache/cookie.c
fs/fscache/internal.h
fs/fscache/page.c
include/linux/fscache-cache.h
include/linux/fscache.h