FS-Cache: Put an aborted initialised op so that it is accounted correctly
authorDavid Howells <dhowells@redhat.com>
Wed, 25 Feb 2015 14:22:40 +0000 (14:22 +0000)
committerDavid Howells <dhowells@redhat.com>
Thu, 2 Apr 2015 13:28:53 +0000 (14:28 +0100)
commita39caadf06879017cb9a8c5c5cb4fc4ccb213275
treea558a3886da28ae502a271ce8597b1860e65594b
parent73c04a47bf79770fbe7f3cf515f5831fccab88ee
FS-Cache: Put an aborted initialised op so that it is accounted correctly

Call fscache_put_operation() or a wrapper on any op that has gone through
fscache_operation_init() so that the accounting shown in /proc is done
correctly, specifically fscache_n_op_release.

fscache_put_operation() therefore now allows an op in the INITIALISED state as
well as in the CANCELLED and COMPLETE states.

Note that this means that an operation can get put that doesn't have its
->object pointer filled in, so anything that depends on the object needs to be
conditional in fscache_put_operation().

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Steve Dickson <steved@redhat.com>
Acked-by: Jeff Layton <jeff.layton@primarydata.com>
fs/fscache/operation.c
fs/fscache/page.c