diff options
Diffstat (limited to 'block/blk-mq-cpu.c')
-rw-r--r-- | block/blk-mq-cpu.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/block/blk-mq-cpu.c b/block/blk-mq-cpu.c index 136ef8643bba..bb3ed488f7b5 100644 --- a/block/blk-mq-cpu.c +++ b/block/blk-mq-cpu.c | |||
@@ -1,3 +1,8 @@ | |||
1 | /* | ||
2 | * CPU notifier helper code for blk-mq | ||
3 | * | ||
4 | * Copyright (C) 2013-2014 Jens Axboe | ||
5 | */ | ||
1 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
2 | #include <linux/module.h> | 7 | #include <linux/module.h> |
3 | #include <linux/init.h> | 8 | #include <linux/init.h> |
@@ -18,14 +23,18 @@ static int blk_mq_main_cpu_notify(struct notifier_block *self, | |||
18 | { | 23 | { |
19 | unsigned int cpu = (unsigned long) hcpu; | 24 | unsigned int cpu = (unsigned long) hcpu; |
20 | struct blk_mq_cpu_notifier *notify; | 25 | struct blk_mq_cpu_notifier *notify; |
26 | int ret = NOTIFY_OK; | ||
21 | 27 | ||
22 | raw_spin_lock(&blk_mq_cpu_notify_lock); | 28 | raw_spin_lock(&blk_mq_cpu_notify_lock); |
23 | 29 | ||
24 | list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) | 30 | list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) { |
25 | notify->notify(notify->data, action, cpu); | 31 | ret = notify->notify(notify->data, action, cpu); |
32 | if (ret != NOTIFY_OK) | ||
33 | break; | ||
34 | } | ||
26 | 35 | ||
27 | raw_spin_unlock(&blk_mq_cpu_notify_lock); | 36 | raw_spin_unlock(&blk_mq_cpu_notify_lock); |
28 | return NOTIFY_OK; | 37 | return ret; |
29 | } | 38 | } |
30 | 39 | ||
31 | void blk_mq_register_cpu_notifier(struct blk_mq_cpu_notifier *notifier) | 40 | void blk_mq_register_cpu_notifier(struct blk_mq_cpu_notifier *notifier) |
@@ -45,7 +54,7 @@ void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier) | |||
45 | } | 54 | } |
46 | 55 | ||
47 | void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier, | 56 | void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier, |
48 | void (*fn)(void *, unsigned long, unsigned int), | 57 | int (*fn)(void *, unsigned long, unsigned int), |
49 | void *data) | 58 | void *data) |
50 | { | 59 | { |
51 | notifier->notify = fn; | 60 | notifier->notify = fn; |