aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-05-21 15:59:08 -0400
committerJens Axboe <axboe@fb.com>2014-05-21 15:59:08 -0400
commite814e71ba4a6e1d7509b0f4b1928365ea650cace (patch)
tree0db6c8a94340addf1f8cab4c4b761bca8df9ab11 /block/blk-mq.c
parentda41a589f52464e24ddefe76814ee35bfb07950c (diff)
blk-mq: allow the hctx cpu hotplug notifier to return errors
Prepare this for the next patch which adds more smarts in the plugging logic, so that we can save some memory. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index ef7ed5e95d6d..5a3683fc5bdb 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1196,8 +1196,8 @@ void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *hctx,
1196} 1196}
1197EXPORT_SYMBOL(blk_mq_free_single_hw_queue); 1197EXPORT_SYMBOL(blk_mq_free_single_hw_queue);
1198 1198
1199static void blk_mq_hctx_notify(void *data, unsigned long action, 1199static int blk_mq_hctx_notify(void *data, unsigned long action,
1200 unsigned int cpu) 1200 unsigned int cpu)
1201{ 1201{
1202 struct blk_mq_hw_ctx *hctx = data; 1202 struct blk_mq_hw_ctx *hctx = data;
1203 struct request_queue *q = hctx->queue; 1203 struct request_queue *q = hctx->queue;
@@ -1205,7 +1205,7 @@ static void blk_mq_hctx_notify(void *data, unsigned long action,
1205 LIST_HEAD(tmp); 1205 LIST_HEAD(tmp);
1206 1206
1207 if (action != CPU_DEAD && action != CPU_DEAD_FROZEN) 1207 if (action != CPU_DEAD && action != CPU_DEAD_FROZEN)
1208 return; 1208 return NOTIFY_OK;
1209 1209
1210 /* 1210 /*
1211 * Move ctx entries to new CPU, if this one is going away. 1211 * Move ctx entries to new CPU, if this one is going away.
@@ -1220,7 +1220,7 @@ static void blk_mq_hctx_notify(void *data, unsigned long action,
1220 spin_unlock(&ctx->lock); 1220 spin_unlock(&ctx->lock);
1221 1221
1222 if (list_empty(&tmp)) 1222 if (list_empty(&tmp))
1223 return; 1223 return NOTIFY_OK;
1224 1224
1225 ctx = blk_mq_get_ctx(q); 1225 ctx = blk_mq_get_ctx(q);
1226 spin_lock(&ctx->lock); 1226 spin_lock(&ctx->lock);
@@ -1240,6 +1240,7 @@ static void blk_mq_hctx_notify(void *data, unsigned long action,
1240 1240
1241 blk_mq_run_hw_queue(hctx, true); 1241 blk_mq_run_hw_queue(hctx, true);
1242 blk_mq_put_ctx(ctx); 1242 blk_mq_put_ctx(ctx);
1243 return NOTIFY_OK;
1243} 1244}
1244 1245
1245static void blk_mq_free_rq_map(struct blk_mq_tag_set *set, 1246static void blk_mq_free_rq_map(struct blk_mq_tag_set *set,