fscache: Fixed incorrect op count check for delayed operations, fixed some debug messages
PATCH 1/1 fscache: Fixed incorrect op count check for delayed operations, fixed some debug messages
fscache_submit_exclusive_op() adds an operation to the pending list if other operations are pending. Fixed the check for pending ops.
Added some missing debug function exit messages.
Signed-off-by Akshat Aranya <[email protected]>
--- fs/fscache/cache.c | 4 +++- fs/fscache/object.c | 1 + fs/fscache/operation.c | 6 ++++-- fs/fscache/page.c | 8 ++++++-- 4 files changed, 14 insertions(+), 5 deletions(-)
fs/fscache/cache.c +3 -1
@@ -153,8 +153,10 @@ struct fscache_cache *fscache_select_cache_for_object(return NULL ; } -if (test_bit (FSCACHE_IOERROR , &tag->cache->flags)) +if (test_bit (FSCACHE_IOERROR , &tag->cache->flags)) { +_leave (" = NULL [io error]" );return NULL ; + }_leave (" = %p [specific]" , tag->cache);return tag->cache;
fs/fscache/object.c +1 -0
@@ -403,6 +403,7 @@ static void fscache_initialise_object(struct fscache_object *object)spin_lock (&object->lock); object->state =FSCACHE_OBJECT_ABORT_INIT ;spin_unlock (&object->lock); +_leave ("" );return ; }
fs/fscache/operation.c +4 -2
@@ -105,7 +105,7 @@ int fscache_submit_exclusive_op(struct fscache_object *object, object->n_ops++; object->n_exclusive++;/* reads and writes must wait */ -if (object->n_ops >0 ) { +if (object->n_ops >1 ) {atomic_inc (&op->usage);list_add_tail (&op->pend_link, &object->pending_ops);fscache_stat (&fscache_n_op_pend);
@@ -336,8 +336,10 @@ void fscache_put_operation(struct fscache_operation *op) ASSERTCMP(atomic_read(&op->usage), >, 0); -if (!atomic_dec_and_test (&op->usage)) +if (!atomic_dec_and_test (&op->usage)) { +_leave (" [active]" );return ; + }fscache_set_op_state (op,"Put" );
fs/fscache/page.c +6 -2
@@ -505,8 +505,10 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,return -ERESTARTSYS ; op =fscache_alloc_retrieval (mapping, end_io_func, context); -if (!op) +if (!op) { +_leave (" = -ENOMEM" );return -ENOMEM ; + }fscache_set_op_name (&op->op,"RetrRAN" );spin_lock (&cookie->lock);
@@ -607,8 +609,10 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,return -ERESTARTSYS ; op =fscache_alloc_retrieval (page->mapping,NULL ,NULL ); -if (!op) +if (!op) { +_leave (" = -ENOMEM" );return -ENOMEM ; + }fscache_set_op_name (&op->op,"RetrAL1" );spin_lock (&cookie->lock);
Signature · 1 line
1.5.5.6