|
@@ -377,6 +377,31 @@ static void cachefiles_sync_cache(struct fscache_cache *_cache)
|
|
|
ret);
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * 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,
|
|
|
};
|