Add atomic_notifier_call_chain_is_empty() that returns true if given atomic call chain is empty. The first user of this new notifier API function will be the kernel power-off core code that will support power-off call chains. The core code will need to check whether there is a power-off handler registered at all in order to decide whether to halt machine or power it off.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -173,6 +173,8 @@ extern int blocking_notifier_call_chain_robust(struct blocking_notifier_head *nh · 172 unmodified lines | ||
| 173 | 173 | extern int raw_notifier_call_chain_robust(struct raw_notifier_head *nh, |
| 174 | 174 | unsigned long val_up, unsigned long val_down, void *v); |
| 175 | 175 | |
| 176 | +extern bool atomic_notifier_call_chain_is_empty(struct atomic_notifier_head *nh); | |
| 177 | + | |
| 176 | 178 | #define NOTIFY_DONE 0x0000 /* Don't care */ |
| 177 | 179 | #define NOTIFY_OK 0x0001 /* Suits me */ |
| 178 | 180 | #define NOTIFY_STOP_MASK 0x8000 /* Don't call further */ |