diff options
author | NeilBrown <neilb@suse.de> | 2012-07-31 03:08:15 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-07-31 03:08:15 -0400 |
commit | 74018dc3063a2c729fc73041c0a9f03aac995920 (patch) | |
tree | 03f01bca3a2d9f7cf31785fbe74e9ab76bb0d4cd /block/blk-core.c | |
parent | 2a7d5559b346574057dce4672d1ed9aaa9d1e685 (diff) |
blk: pass from_schedule to non-request unplug functions.
This will allow md/raid to know why the unplug was called,
and will be able to act according - if !from_schedule it
is safe to perform tasks which could themselves schedule.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 35bf4fe8234c..4b4dbdfbca89 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2909,7 +2909,7 @@ static void queue_unplugged(struct request_queue *q, unsigned int depth, | |||
2909 | 2909 | ||
2910 | } | 2910 | } |
2911 | 2911 | ||
2912 | static void flush_plug_callbacks(struct blk_plug *plug) | 2912 | static void flush_plug_callbacks(struct blk_plug *plug, bool from_schedule) |
2913 | { | 2913 | { |
2914 | LIST_HEAD(callbacks); | 2914 | LIST_HEAD(callbacks); |
2915 | 2915 | ||
@@ -2921,7 +2921,7 @@ static void flush_plug_callbacks(struct blk_plug *plug) | |||
2921 | struct blk_plug_cb, | 2921 | struct blk_plug_cb, |
2922 | list); | 2922 | list); |
2923 | list_del(&cb->list); | 2923 | list_del(&cb->list); |
2924 | cb->callback(cb); | 2924 | cb->callback(cb, from_schedule); |
2925 | } | 2925 | } |
2926 | } | 2926 | } |
2927 | } | 2927 | } |
@@ -2961,7 +2961,7 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) | |||
2961 | 2961 | ||
2962 | BUG_ON(plug->magic != PLUG_MAGIC); | 2962 | BUG_ON(plug->magic != PLUG_MAGIC); |
2963 | 2963 | ||
2964 | flush_plug_callbacks(plug); | 2964 | flush_plug_callbacks(plug, from_schedule); |
2965 | if (list_empty(&plug->list)) | 2965 | if (list_empty(&plug->list)) |
2966 | return; | 2966 | return; |
2967 | 2967 | ||