With the use count tracking I've added for proc_dir_entries I can tell
when the last use is released, but this needs to be translated into an
appropriate MOD_DEC_USE_COUNT. The only way I can think to do this is
to add another function pointer to proc_dir_entry that would increment
or decrement the module count. Permanent entries or non-module code
could leave it as NULL or just an empty function. The code might be
something like
void mod_use_count(int up)
{
if (up)
MOD_INC_USE_COUNT;
else
MOD_DEC_USE_COUNT;
}
This would require adding the routine to each module, but on the other
hand would simplify module use count tracking, as you wouldn't need it
in the read/write/etc routines.
Does this seem reasonable, or can anyone else think of a better way?
Regards,
Bill