Yep, much simpler. Couple of comments:
> +static inline int register_module_notifier(struct notifier_block * nb)
> +{
> + return -ENOSYS;
> +}
> +
> +static inline int unregister_module_notifier(struct notifier_block * nb)
> +{
> + return -ENOSYS;
> +}
> +
> #endif /* CONFIG_MODULES */
Shouldn't fail just because !CONFIG_MODULES: should just return 0.
Otherwise there's no way to sanely use them without wrapping in #ifdef
CONFIG_MODULES (in which case why have the non-module definition at
all?).
> +static DECLARE_MUTEX(notify_mutex);
Hmm, yes, you need to use your own protection around
notifier_chain_register and notifier_call_chain. Wierd, because
notifier.c does its own locking for register and unregister, but not
for calling, which AFAICT makes it useless...
Rusty.
-- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/