How do I implement a use counter for 2.5 modules?

From: Marcel Offermans (marcel.offermans@luminis.nl)
Date: Wed May 28 2003 - 05:02:03 EST


I am currently porting a CAN driver module from 2.4 to 2.5 and one of the
things I did was remove the MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT macros
from the code. This now means that rmmod will remove my module even when
it is still in use. What mechanism should I use to prevent this? I know
how to logically detect if the module is in use (there's a variable that
keeps track of this already in the code), I just don't know what new API I
should use.


-
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/