FS-Cache: Make cookie relinquishment wait for outstanding reads
Make fscache_relinquish_cookie() log a warning and wait if there are any outstanding reads left on the cookie it was given. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
@@ -340,8 +340,14 @@ void fscache_put_operation(struct fscache_operation *op)
|
||||
|
||||
object = op->object;
|
||||
|
||||
if (test_bit(FSCACHE_OP_DEC_READ_CNT, &op->flags))
|
||||
atomic_dec(&object->n_reads);
|
||||
if (test_bit(FSCACHE_OP_DEC_READ_CNT, &op->flags)) {
|
||||
if (atomic_dec_and_test(&object->n_reads)) {
|
||||
clear_bit(FSCACHE_COOKIE_WAITING_ON_READS,
|
||||
&object->cookie->flags);
|
||||
wake_up_bit(&object->cookie->flags,
|
||||
FSCACHE_COOKIE_WAITING_ON_READS);
|
||||
}
|
||||
}
|
||||
|
||||
/* now... we may get called with the object spinlock held, so we
|
||||
* complete the cleanup here only if we can immediately acquire the
|
||||
|
Reference in New Issue
Block a user