summaryrefslogtreecommitdiffstats
path: root/fs/fscache/operation.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-12-13 20:03:13 +0000
committerDavid Howells <dhowells@redhat.com>2012-12-20 22:34:00 +0000
commit1f372dff1da37e2b36ae9085368fa46896398598 (patch)
treef47b00dc61c9cf6c0eaa6d437bd7f91bfcb4d76d /fs/fscache/operation.c
parent7ef001e937e8b9cbedb2fc1c31dd681ac3b31927 (diff)
downloadlinux-1f372dff1da37e2b36ae9085368fa46896398598.tar.bz2
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)
}
/*
- * Record the completion of an in-progress operation.
+ * Record the completion or cancellation of an in-progress operation.
*/
-void fscache_op_complete(struct fscache_operation *op)
+void fscache_op_complete(struct fscache_operation *op, bool cancelled)
{
struct fscache_object *object = op->object;
@@ -380,7 +380,8 @@ void fscache_op_complete(struct fscache_operation *op)
spin_lock(&object->lock);
- op->state = FSCACHE_OP_ST_COMPLETE;
+ op->state = cancelled ?
+ FSCACHE_OP_ST_CANCELLED : FSCACHE_OP_ST_COMPLETE;
if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
object->n_exclusive--;