summaryrefslogtreecommitdiff
path: root/fs/cachefiles/interface.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-10-02 07:55:54 +0200
committerIngo Molnar <mingo@kernel.org>2013-10-02 07:55:54 +0200
commit8a60d42d26d31df8121b251c2b5c56eb24e729f1 (patch)
tree493db0b300a36aa539d7ebe6f8130ad6b54c4a6d /fs/cachefiles/interface.c
parent7752572f18f98ee796e173334b088a1d621d2da4 (diff)
parent15c03dd4859ab16f9212238f29dd315654aa94f6 (diff)
Merge tag 'v3.12-rc3' into irq/core
Merge Linux v3.12-rc3, to refresh the tree from a v3.11 base to a v3.12 base. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/cachefiles/interface.c')
-rw-r--r--fs/cachefiles/interface.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c
index d4c1206af9fc..43eb5592cdea 100644
--- a/fs/cachefiles/interface.c
+++ b/fs/cachefiles/interface.c
@@ -378,6 +378,31 @@ static void cachefiles_sync_cache(struct fscache_cache *_cache)
}
/*
+ * check if the backing cache is updated to FS-Cache
+ * - called by FS-Cache when evaluates if need to invalidate the cache
+ */
+static bool cachefiles_check_consistency(struct fscache_operation *op)
+{
+ struct cachefiles_object *object;
+ struct cachefiles_cache *cache;
+ const struct cred *saved_cred;
+ int ret;
+
+ _enter("{OBJ%x}", op->object->debug_id);
+
+ object = container_of(op->object, struct cachefiles_object, fscache);
+ cache = container_of(object->fscache.cache,
+ struct cachefiles_cache, cache);
+
+ cachefiles_begin_secure(cache, &saved_cred);
+ ret = cachefiles_check_auxdata(object);
+ cachefiles_end_secure(cache, saved_cred);
+
+ _leave(" = %d", ret);
+ return ret;
+}
+
+/*
* notification the attributes on an object have changed
* - called with reads/writes excluded by FS-Cache
*/
@@ -522,4 +547,5 @@ const struct fscache_cache_ops cachefiles_cache_ops = {
.write_page = cachefiles_write_page,
.uncache_page = cachefiles_uncache_page,
.dissociate_pages = cachefiles_dissociate_pages,
+ .check_consistency = cachefiles_check_consistency,
};