aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-04-15 09:20:10 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-04-15 09:20:10 -0400
commit88b996cd0652280cc9b9fc70008fda15f14175e1 (patch)
treec842575e47ab094bced8a01b241568616e89366a /block
parent80656b67b3988f83edd86a280d9937124fe62050 (diff)
block: cleanup the block plug helper functions
It's a bit of a mess currently. task->plug is being cleared and reset in __blk_finish_plug(), and blk_finish_plug() is testing for a NULL plug which cannot happen even from schedule() anymore since it uses blk_needs_flush_plug() to determine whether to call into this function at all. So get rid of some of the cruft. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 36b1a7559f94..b598fa7720d4 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2671,7 +2671,7 @@ static void queue_unplugged(struct request_queue *q, unsigned int depth)
2671 q->unplugged_fn(q); 2671 q->unplugged_fn(q);
2672} 2672}
2673 2673
2674static void flush_plug_list(struct blk_plug *plug) 2674void blk_flush_plug_list(struct blk_plug *plug)
2675{ 2675{
2676 struct request_queue *q; 2676 struct request_queue *q;
2677 unsigned long flags; 2677 unsigned long flags;
@@ -2733,28 +2733,16 @@ static void flush_plug_list(struct blk_plug *plug)
2733 2733
2734 local_irq_restore(flags); 2734 local_irq_restore(flags);
2735} 2735}
2736 2736EXPORT_SYMBOL(blk_flush_plug_list);
2737static void __blk_finish_plug(struct task_struct *tsk, struct blk_plug *plug)
2738{
2739 flush_plug_list(plug);
2740
2741 if (plug == tsk->plug)
2742 tsk->plug = NULL;
2743}
2744 2737
2745void blk_finish_plug(struct blk_plug *plug) 2738void blk_finish_plug(struct blk_plug *plug)
2746{ 2739{
2747 if (plug) 2740 blk_flush_plug_list(plug);
2748 __blk_finish_plug(current, plug);
2749}
2750EXPORT_SYMBOL(blk_finish_plug);
2751 2741
2752void __blk_flush_plug(struct task_struct *tsk, struct blk_plug *plug) 2742 if (plug == current->plug)
2753{ 2743 current->plug = NULL;
2754 __blk_finish_plug(tsk, plug);
2755 tsk->plug = plug;
2756} 2744}
2757EXPORT_SYMBOL(__blk_flush_plug); 2745EXPORT_SYMBOL(blk_finish_plug);
2758 2746
2759int __init blk_dev_init(void) 2747int __init blk_dev_init(void)
2760{ 2748{