aboutsummaryrefslogtreecommitdiffstats
path: root/block/ll_rw_blk.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-28 12:25:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-28 12:25:44 -0500
commit7baf398f12585ae77748716fa77113c1f1831153 (patch)
tree492361d848d3dfc33563a1bdf0d0f61b454aac82 /block/ll_rw_blk.c
parent78cd9e04e0acea4f622e84ca0c760c7eae0c6854 (diff)
parent206dc69b31ca05baac68c75b8ed2ba7dd857d273 (diff)
Merge branch 'cfq-merge' of git://brick.kernel.dk/data/git/linux-2.6-block
* 'cfq-merge' of git://brick.kernel.dk/data/git/linux-2.6-block: [BLOCK] cfq-iosched: seek and async performance fixes [PATCH] ll_rw_blk: fix 80-col offender in put_io_context() [PATCH] cfq-iosched: small cfq_choose_req() optimization [PATCH] [BLOCK] cfq-iosched: change cfq io context linking from list to tree
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r--block/ll_rw_blk.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 5a19e2eb5711..5b26af8597f3 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3539,11 +3539,17 @@ void put_io_context(struct io_context *ioc)
3539 BUG_ON(atomic_read(&ioc->refcount) == 0); 3539 BUG_ON(atomic_read(&ioc->refcount) == 0);
3540 3540
3541 if (atomic_dec_and_test(&ioc->refcount)) { 3541 if (atomic_dec_and_test(&ioc->refcount)) {
3542 struct cfq_io_context *cic;
3543
3542 rcu_read_lock(); 3544 rcu_read_lock();
3543 if (ioc->aic && ioc->aic->dtor) 3545 if (ioc->aic && ioc->aic->dtor)
3544 ioc->aic->dtor(ioc->aic); 3546 ioc->aic->dtor(ioc->aic);
3545 if (ioc->cic && ioc->cic->dtor) 3547 if (ioc->cic_root.rb_node != NULL) {
3546 ioc->cic->dtor(ioc->cic); 3548 struct rb_node *n = rb_first(&ioc->cic_root);
3549
3550 cic = rb_entry(n, struct cfq_io_context, rb_node);
3551 cic->dtor(ioc);
3552 }
3547 rcu_read_unlock(); 3553 rcu_read_unlock();
3548 3554
3549 kmem_cache_free(iocontext_cachep, ioc); 3555 kmem_cache_free(iocontext_cachep, ioc);
@@ -3556,6 +3562,7 @@ void exit_io_context(void)
3556{ 3562{
3557 unsigned long flags; 3563 unsigned long flags;
3558 struct io_context *ioc; 3564 struct io_context *ioc;
3565 struct cfq_io_context *cic;
3559 3566
3560 local_irq_save(flags); 3567 local_irq_save(flags);
3561 task_lock(current); 3568 task_lock(current);
@@ -3567,9 +3574,11 @@ void exit_io_context(void)
3567 3574
3568 if (ioc->aic && ioc->aic->exit) 3575 if (ioc->aic && ioc->aic->exit)
3569 ioc->aic->exit(ioc->aic); 3576 ioc->aic->exit(ioc->aic);
3570 if (ioc->cic && ioc->cic->exit) 3577 if (ioc->cic_root.rb_node != NULL) {
3571 ioc->cic->exit(ioc->cic); 3578 cic = rb_entry(rb_first(&ioc->cic_root), struct cfq_io_context, rb_node);
3572 3579 cic->exit(ioc);
3580 }
3581
3573 put_io_context(ioc); 3582 put_io_context(ioc);
3574} 3583}
3575 3584
@@ -3598,7 +3607,7 @@ struct io_context *current_io_context(gfp_t gfp_flags)
3598 ret->last_waited = jiffies; /* doesn't matter... */ 3607 ret->last_waited = jiffies; /* doesn't matter... */
3599 ret->nr_batch_requests = 0; /* because this is 0 */ 3608 ret->nr_batch_requests = 0; /* because this is 0 */
3600 ret->aic = NULL; 3609 ret->aic = NULL;
3601 ret->cic = NULL; 3610 ret->cic_root.rb_node = NULL;
3602 tsk->io_context = ret; 3611 tsk->io_context = ret;
3603 } 3612 }
3604 3613