kernel_optimize_test/fs/fscache
David Howells 8fb883f3e3 FS-Cache: Add use/unuse/wake cookie wrappers
Add wrapper functions for dealing with cookie->n_active:

 (*) __fscache_use_cookie() to increment it.

 (*) __fscache_unuse_cookie() to decrement and test against zero.

 (*) __fscache_wake_unused_cookie() to wake up anyone waiting for it to reach
     zero.

The second and third are split so that the third can be done after cookie->lock
has been released in case the waiter wakes up whilst we're still holding it and
tries to get it.

We will need to wake-on-zero once the cookie disablement patch is applied
because it will then be possible to see n_active become zero without the cookie
being relinquished.

Also move the cookie usement out of fscache_attr_changed_op() and into
fscache_attr_changed() and the operation struct so that cookie disablement
will be able to track it.

Whilst we're at it, only increment n_active if we're about to do
fscache_submit_op() so that we don't have to deal with undoing it if anything
earlier fails.  Possibly this should be moved into fscache_submit_op() which
could look at FSCACHE_OP_UNUSE_COOKIE.

Signed-off-by: David Howells <dhowells@redhat.com>
2013-09-27 18:40:25 +01:00
..
cache.c FS-Cache: Fix object state machine to have separate work and wait states 2013-06-19 14:16:47 +01:00
cookie.c FS-Cache: Add use/unuse/wake cookie wrappers 2013-09-27 18:40:25 +01:00
fsdef.c FS-Cache: Simplify cookie retention for fscache_objects, fixing oops 2013-06-19 14:16:47 +01:00
histogram.c
internal.h FS-Cache: Add interface to check consistency of a cached object 2013-09-06 09:17:30 +01:00
Kconfig
main.c FS-Cache: Simplify cookie retention for fscache_objects, fixing oops 2013-06-19 14:16:47 +01:00
Makefile
netfs.c FS-Cache: Simplify cookie retention for fscache_objects, fixing oops 2013-06-19 14:16:47 +01:00
object-list.c FS-Cache: Simplify cookie retention for fscache_objects, fixing oops 2013-06-19 14:16:47 +01:00
object.c FS-Cache: Simplify cookie retention for fscache_objects, fixing oops 2013-06-19 14:16:47 +01:00
operation.c FS-Cache: Don't use spin_is_locked() in assertions 2013-06-19 14:16:47 +01:00
page.c FS-Cache: Add use/unuse/wake cookie wrappers 2013-09-27 18:40:25 +01:00
proc.c
stats.c fs/fscache/stats.c: fix memory leak 2013-04-29 15:54:27 -07:00