aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fscache-cache.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-12-20 16:52:36 -0500
committerDavid Howells <dhowells@redhat.com>2012-12-20 17:04:07 -0500
commitef778e7ae67cd426c30cad43378b908f5eb0bad5 (patch)
tree4893f19487cb99e8ec0eb835ec4391d952641a9c /include/linux/fscache-cache.h
parent9f10523f891928330b7529da54c1a3cc65180b1a (diff)
FS-Cache: Provide proper invalidation
Provide a proper invalidation method rather than relying on the netfs retiring the cookie it has and getting a new one. The problem with this is that isn't easy for the netfs to make sure that it has completed/cancelled all its outstanding storage and retrieval operations on the cookie it is retiring. Instead, have the cache provide an invalidation method that will cancel or wait for all currently outstanding operations before invalidating the cache, and will cause new operations to queue up behind that. Whilst invalidation is in progress, some requests will be rejected until the cache can stack a barrier on the operation queue to cause new operations to be deferred behind it. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux/fscache-cache.h')
-rw-r--r--include/linux/fscache-cache.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index f5facd1d333f..1e454ad7a832 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -254,6 +254,9 @@ struct fscache_cache_ops {
254 /* store the updated auxiliary data on an object */ 254 /* store the updated auxiliary data on an object */
255 void (*update_object)(struct fscache_object *object); 255 void (*update_object)(struct fscache_object *object);
256 256
257 /* Invalidate an object */
258 void (*invalidate_object)(struct fscache_operation *op);
259
257 /* discard the resources pinned by an object and effect retirement if 260 /* discard the resources pinned by an object and effect retirement if
258 * necessary */ 261 * necessary */
259 void (*drop_object)(struct fscache_object *object); 262 void (*drop_object)(struct fscache_object *object);
@@ -329,6 +332,7 @@ struct fscache_cookie {
329#define FSCACHE_COOKIE_FILLING 4 /* T if filling object incrementally */ 332#define FSCACHE_COOKIE_FILLING 4 /* T if filling object incrementally */
330#define FSCACHE_COOKIE_UNAVAILABLE 5 /* T if cookie is unavailable (error, etc) */ 333#define FSCACHE_COOKIE_UNAVAILABLE 5 /* T if cookie is unavailable (error, etc) */
331#define FSCACHE_COOKIE_WAITING_ON_READS 6 /* T if cookie is waiting on reads */ 334#define FSCACHE_COOKIE_WAITING_ON_READS 6 /* T if cookie is waiting on reads */
335#define FSCACHE_COOKIE_INVALIDATING 7 /* T if cookie is being invalidated */
332}; 336};
333 337
334extern struct fscache_cookie fscache_fsdef_index; 338extern struct fscache_cookie fscache_fsdef_index;
@@ -345,6 +349,7 @@ struct fscache_object {
345 /* active states */ 349 /* active states */
346 FSCACHE_OBJECT_AVAILABLE, /* cleaning up object after creation */ 350 FSCACHE_OBJECT_AVAILABLE, /* cleaning up object after creation */
347 FSCACHE_OBJECT_ACTIVE, /* object is usable */ 351 FSCACHE_OBJECT_ACTIVE, /* object is usable */
352 FSCACHE_OBJECT_INVALIDATING, /* object is invalidating */
348 FSCACHE_OBJECT_UPDATING, /* object is updating */ 353 FSCACHE_OBJECT_UPDATING, /* object is updating */
349 354
350 /* terminal states */ 355 /* terminal states */
@@ -378,7 +383,8 @@ struct fscache_object {
378#define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ 383#define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */
379#define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ 384#define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */
380#define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ 385#define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */
381#define FSCACHE_OBJECT_EVENTS_MASK 0x7f /* mask of all events*/ 386#define FSCACHE_OBJECT_EV_INVALIDATE 7 /* T if cache requested object invalidation */
387#define FSCACHE_OBJECT_EVENTS_MASK 0xff /* mask of all events*/
382 388
383 unsigned long flags; 389 unsigned long flags;
384#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ 390#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */