aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache/operation.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-12-13 15:03:13 -0500
committerDavid Howells <dhowells@redhat.com>2012-12-20 17:34:00 -0500
commit1f372dff1da37e2b36ae9085368fa46896398598 (patch)
treef47b00dc61c9cf6c0eaa6d437bd7f91bfcb4d76d /fs/fscache/operation.c
parent7ef001e937e8b9cbedb2fc1c31dd681ac3b31927 (diff)
FS-Cache: Mark cancellation of in-progress operation
Mark as cancelled an operation that is in progress rather than pending at the time it is cancelled, and call fscache_complete_op() to cancel an operation so that blocked ops can be started. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/operation.c')
-rw-r--r--fs/fscache/operation.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c
index 9e6b7d232bb1..36c59604130d 100644
--- a/fs/fscache/operation.c
+++ b/fs/fscache/operation.c
@@ -363,9 +363,9 @@ void fscache_cancel_all_ops(struct fscache_object *object)
363} 363}
364 364
365/* 365/*
366 * Record the completion of an in-progress operation. 366 * Record the completion or cancellation of an in-progress operation.
367 */ 367 */
368void fscache_op_complete(struct fscache_operation *op) 368void fscache_op_complete(struct fscache_operation *op, bool cancelled)
369{ 369{
370 struct fscache_object *object = op->object; 370 struct fscache_object *object = op->object;
371 371
@@ -380,7 +380,8 @@ void fscache_op_complete(struct fscache_operation *op)
380 380
381 spin_lock(&object->lock); 381 spin_lock(&object->lock);
382 382
383 op->state = FSCACHE_OP_ST_COMPLETE; 383 op->state = cancelled ?
384 FSCACHE_OP_ST_CANCELLED : FSCACHE_OP_ST_COMPLETE;
384 385
385 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags)) 386 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
386 object->n_exclusive--; 387 object->n_exclusive--;