From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Date: Sat, 31 Mar 2001 16:52:33 +0000 Subject: Re: (remove) event not supported. Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org > >It's not a reference count, since it doesn't address the case where > >another module references it > > It is a dynamic reference count. The reference from another module is > a static reference count. Historical. I see what you're saying, but that doesn't mean I'd then agree to call it a "reference" count! > >Since the counter can be (as > >you highlighted!) updated at any time, there's nothing to make it > >be a "reference" count. > > The networking framework is pretty explicit > >that it must be used as an "open" count > > If networking framework says that then it is wrong. > > >(SET_MODULE_OWNER arranges this). > > SET_MODULE_OWNER only exports the address of the module structure so > external code can adjust the use count. When the interface is opened or closed ... and a few other cases related to calling into the module. (Related point: I suspect the USB code should do the same when it probes drivers, to avoid those same races.) >From the perspective of a normal user, "lsmod" for net drivers shows use count 0 when no interface exposed by that driver is "up" (open). > Normally that is via the open > routine, but file systems just do one MOD_INC_USE_COUNT in fs/super.c > so it is a mount count, not an open count. Some netfilter modules want > to count the number of packets controlled by that module, again not an > open count. I'd argue those are all logically equivalent to "open": dynamic behavior (as you noted) that needs to prevent "rmmod". One hopes that opening a block device like /dev/sda1 with a user mode tool, rather than "mount", will prevent "rmmod"... - Dave _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel