3 #include <linux/export.h>
7 #include <linux/reboot.h>
24 while ((*nl) !=
NULL) {
34 static int notifier_chain_cond_register(
struct notifier_block **nl,
37 while ((*nl) !=
NULL) {
52 while ((*nl) !=
NULL) {
75 unsigned long val,
void *
v,
76 int nr_to_call,
int *nr_calls)
78 int ret = NOTIFY_DONE;
83 while (nb && nr_to_call) {
86 #ifdef CONFIG_DEBUG_NOTIFIERS
88 WARN(1,
"Invalid notifier called!");
98 if ((ret & NOTIFY_STOP_MASK) == NOTIFY_STOP_MASK)
127 ret = notifier_chain_register(&nh->
head, n);
128 spin_unlock_irqrestore(&nh->
lock, flags);
149 ret = notifier_chain_unregister(&nh->
head, n);
150 spin_unlock_irqrestore(&nh->
lock, flags);
176 unsigned long val,
void *v,
177 int nr_to_call,
int *nr_calls)
182 ret = notifier_call_chain(&nh->
head, val, v, nr_to_call, nr_calls);
189 unsigned long val,
void *v)
221 return notifier_chain_register(&nh->
head, n);
224 ret = notifier_chain_register(&nh->
head, n);
247 ret = notifier_chain_cond_register(&nh->
head, n);
274 return notifier_chain_unregister(&nh->
head, n);
277 ret = notifier_chain_unregister(&nh->
head, n);
302 unsigned long val,
void *v,
303 int nr_to_call,
int *nr_calls)
305 int ret = NOTIFY_DONE;
314 ret = notifier_call_chain(&nh->
head, val, v, nr_to_call,
323 unsigned long val,
void *v)
347 return notifier_chain_register(&nh->
head, n);
364 return notifier_chain_unregister(&nh->
head, n);
388 unsigned long val,
void *v,
389 int nr_to_call,
int *nr_calls)
391 return notifier_call_chain(&nh->
head, val, v, nr_to_call, nr_calls);
396 unsigned long val,
void *v)
428 return notifier_chain_register(&nh->
head, n);
431 ret = notifier_chain_register(&nh->
head, n);
458 return notifier_chain_unregister(&nh->
head, n);
461 ret = notifier_chain_unregister(&nh->
head, n);
487 unsigned long val,
void *v,
488 int nr_to_call,
int *nr_calls)
493 idx = srcu_read_lock(&nh->
srcu);
494 ret = notifier_call_chain(&nh->
head, val, v, nr_to_call, nr_calls);
495 srcu_read_unlock(&nh->
srcu, idx);
501 unsigned long val,
void *v)