Re: [PATCH] module load notification try 2

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Sat Mar 22 2003 - 23:36:26 EST


In message <20030318155953.GA97463@compsoc.man.ac.uk> you write:
>
> Rusty, any happier with this one ?

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/



This archive was generated by hypermail 2b29 : Mon Mar 31 2003 - 22:00:18 EST