diff options
-rw-r--r-- | block/blk-core.c | 24 | ||||
-rw-r--r-- | include/linux/blkdev.h | 6 |
2 files changed, 9 insertions, 21 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 | ||
2674 | static void flush_plug_list(struct blk_plug *plug) | 2674 | void 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 | 2736 | EXPORT_SYMBOL(blk_flush_plug_list); | |
2737 | static 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 | ||
2745 | void blk_finish_plug(struct blk_plug *plug) | 2738 | void 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 | } | ||
2750 | EXPORT_SYMBOL(blk_finish_plug); | ||
2751 | 2741 | ||
2752 | void __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 | } |
2757 | EXPORT_SYMBOL(__blk_flush_plug); | 2745 | EXPORT_SYMBOL(blk_finish_plug); |
2758 | 2746 | ||
2759 | int __init blk_dev_init(void) | 2747 | int __init blk_dev_init(void) |
2760 | { | 2748 | { |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c07ffafac5d4..ffe48ff318f9 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -865,14 +865,14 @@ struct blk_plug { | |||
865 | 865 | ||
866 | extern void blk_start_plug(struct blk_plug *); | 866 | extern void blk_start_plug(struct blk_plug *); |
867 | extern void blk_finish_plug(struct blk_plug *); | 867 | extern void blk_finish_plug(struct blk_plug *); |
868 | extern void __blk_flush_plug(struct task_struct *, struct blk_plug *); | 868 | extern void blk_flush_plug_list(struct blk_plug *); |
869 | 869 | ||
870 | static inline void blk_flush_plug(struct task_struct *tsk) | 870 | static inline void blk_flush_plug(struct task_struct *tsk) |
871 | { | 871 | { |
872 | struct blk_plug *plug = tsk->plug; | 872 | struct blk_plug *plug = tsk->plug; |
873 | 873 | ||
874 | if (unlikely(plug)) | 874 | if (plug) |
875 | __blk_flush_plug(tsk, plug); | 875 | blk_flush_plug_list(plug); |
876 | } | 876 | } |
877 | 877 | ||
878 | static inline bool blk_needs_flush_plug(struct task_struct *tsk) | 878 | static inline bool blk_needs_flush_plug(struct task_struct *tsk) |