Re: [PATCH] rmmod notifier chain

From: Jan Beulich
Date: Thu Sep 08 2005 - 10:16:17 EST


>> Debugging and maintenance support code occasionally needs to know
not
>> only of module insertions, but also modulke removals. This adds a
>> notifier
>> chain for this purpose.
>>
>>
>> diff -Npru 2.6.13/kernel/module.c
>> 2.6.13-rmmod-notifier/kernel/module.c
>> --- 2.6.13/kernel/module.c 2005-08-29 01:41:01.000000000 +0200
>> +++ 2.6.13-rmmod-notifier/kernel/module.c 2005-09-02
>> 09:46:24.000000000 +0200
>> @@ -62,6 +62,8 @@ static LIST_HEAD(modules);
>>
>> static DECLARE_MUTEX(notify_mutex);
>> static struct notifier_block * module_notify_list;
>> +static DECLARE_MUTEX(rmmod_notify_mutex);
>
>Why is this mutex needed? The notifier functions already take care of
>locking.

As you can see in the fragment, the same is being done for the insert
notifier chain, and I simply copied and modified that code to have the
lowest possible risk. If that's inappropriate, then the insert notifier
should probably be fixed first...

Jan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/