aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq-cpu.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-cpu.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-cpu.c')
-rw-r--r--block/blk-mq-cpu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/block/blk-mq-cpu.c b/block/blk-mq-cpu.c
index 136ef8643bba..d2c253f71b86 100644
--- a/block/blk-mq-cpu.c
+++ b/block/blk-mq-cpu.c
@@ -18,14 +18,18 @@ static int blk_mq_main_cpu_notify(struct notifier_block *self,
18{ 18{
19 unsigned int cpu = (unsigned long) hcpu; 19 unsigned int cpu = (unsigned long) hcpu;
20 struct blk_mq_cpu_notifier *notify; 20 struct blk_mq_cpu_notifier *notify;
21 int ret = NOTIFY_OK;
21 22
22 raw_spin_lock(&blk_mq_cpu_notify_lock); 23 raw_spin_lock(&blk_mq_cpu_notify_lock);
23 24
24 list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) 25 list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) {
25 notify->notify(notify->data, action, cpu); 26 ret = notify->notify(notify->data, action, cpu);
27 if (ret != NOTIFY_OK)
28 break;
29 }
26 30
27 raw_spin_unlock(&blk_mq_cpu_notify_lock); 31 raw_spin_unlock(&blk_mq_cpu_notify_lock);
28 return NOTIFY_OK; 32 return ret;
29} 33}
30 34
31void blk_mq_register_cpu_notifier(struct blk_mq_cpu_notifier *notifier) 35void blk_mq_register_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
@@ -45,7 +49,7 @@ void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
45} 49}
46 50
47void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier, 51void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,
48 void (*fn)(void *, unsigned long, unsigned int), 52 int (*fn)(void *, unsigned long, unsigned int),
49 void *data) 53 void *data)
50{ 54{
51 notifier->notify = fn; 55 notifier->notify = fn;