diff options
author | David Howells <dhowells@redhat.com> | 2018-04-04 08:41:26 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-04-04 08:41:26 -0400 |
commit | b27ddd46245311850f850024df54d0537506f3c1 (patch) | |
tree | a3e7bfea00d0cfd2e6969d124b15d4bd2bffa9be /fs/fscache | |
parent | bfa3837ec3ccda3138ce9b798107aadcc6d2e78c (diff) |
fscache: Pass the correct cancelled indications to fscache_op_complete()
The last parameter to fscache_op_complete() is a bool indicating whether or
not the operation was cancelled. A lot of the time the inverse value is
given or no differentiation is made. Fix this.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r-- | fs/fscache/page.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index 961029e04027..adc39c0c62df 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c | |||
@@ -185,9 +185,11 @@ static void fscache_attr_changed_op(struct fscache_operation *op) | |||
185 | fscache_stat_d(&fscache_n_cop_attr_changed); | 185 | fscache_stat_d(&fscache_n_cop_attr_changed); |
186 | if (ret < 0) | 186 | if (ret < 0) |
187 | fscache_abort_object(object); | 187 | fscache_abort_object(object); |
188 | fscache_op_complete(op, ret < 0); | ||
189 | } else { | ||
190 | fscache_op_complete(op, true); | ||
188 | } | 191 | } |
189 | 192 | ||
190 | fscache_op_complete(op, true); | ||
191 | _leave(""); | 193 | _leave(""); |
192 | } | 194 | } |
193 | 195 | ||
@@ -780,11 +782,12 @@ static void fscache_write_op(struct fscache_operation *_op) | |||
780 | cookie = object->cookie; | 782 | cookie = object->cookie; |
781 | 783 | ||
782 | if (!fscache_object_is_active(object)) { | 784 | if (!fscache_object_is_active(object)) { |
783 | /* If we get here, then the on-disk cache object likely longer | 785 | /* If we get here, then the on-disk cache object likely no |
784 | * exists, so we should just cancel this write operation. | 786 | * longer exists, so we should just cancel this write |
787 | * operation. | ||
785 | */ | 788 | */ |
786 | spin_unlock(&object->lock); | 789 | spin_unlock(&object->lock); |
787 | fscache_op_complete(&op->op, false); | 790 | fscache_op_complete(&op->op, true); |
788 | _leave(" [inactive]"); | 791 | _leave(" [inactive]"); |
789 | return; | 792 | return; |
790 | } | 793 | } |
@@ -797,7 +800,7 @@ static void fscache_write_op(struct fscache_operation *_op) | |||
797 | * cancel this write operation. | 800 | * cancel this write operation. |
798 | */ | 801 | */ |
799 | spin_unlock(&object->lock); | 802 | spin_unlock(&object->lock); |
800 | fscache_op_complete(&op->op, false); | 803 | fscache_op_complete(&op->op, true); |
801 | _leave(" [cancel] op{f=%lx s=%u} obj{s=%s f=%lx}", | 804 | _leave(" [cancel] op{f=%lx s=%u} obj{s=%s f=%lx}", |
802 | _op->flags, _op->state, object->state->short_name, | 805 | _op->flags, _op->state, object->state->short_name, |
803 | object->flags); | 806 | object->flags); |
@@ -851,7 +854,7 @@ superseded: | |||
851 | spin_unlock(&cookie->stores_lock); | 854 | spin_unlock(&cookie->stores_lock); |
852 | clear_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags); | 855 | clear_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags); |
853 | spin_unlock(&object->lock); | 856 | spin_unlock(&object->lock); |
854 | fscache_op_complete(&op->op, true); | 857 | fscache_op_complete(&op->op, false); |
855 | _leave(""); | 858 | _leave(""); |
856 | } | 859 | } |
857 | 860 | ||