RE: More about MOD_INC_USE_COUNT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I spent all last night searching the LKML archives for the Rusty Russell
HOWTO that John mentions, but I can't find it.
I found a bunch of links to a HOWTO for ip-chains, but nothing for modules.
Could anyone point me to that reference ?

I read the Linux Device Drivers (Rubini) book on 'The Module usage Counter'.

I see that in 2.4 I can/should do:
 owner: THIS_MODULE,
in my file_operations structure.
But both LDD & UTLK are light on exactly what this means.

This link 
http://www.ibiblio.org/pub/Linux/docs/HOWTO/Module-HOWTO
talks about registering a callback function that will return T/F to tell the
module manager whether it can unload or not.  However, I don't understand
how 'owner:THIS_MODULE' does this for me.  Does THIS_MODULE just point to a
default module structure ? 
Can anyone point me to an example of how to use this ?

It seems obvious that I'm currently not doing the right thing, and I'd
really like to understand this.

Any help much appreciated
regards
dom


> -----Original Message-----
> From: John Levon [mailto:levon@movementarian.org]
> Sent: Sunday, December 08, 2002 7:21 PM
> To: Curran, Dominic
> Cc: kernelnewbies@nl.linux.org
> Subject: Re: More about MOD_INC_USE_COUNT
> 
> 
> On Sun, Dec 08, 2002 at 07:10:39PM -0600, Curran, Dominic wrote:
> 
> > You want to put it in your open handler.  This is the 
> handler that gets
> > called when a user mode app opens a handle (file 
> descriptor) to your driver
> > using fd=open("/dev/mydriver",...).
> 
> No you don't. You want to set the relevant .owner field in the ops
> structure you pass to the register function to be "THIS_MODULE"
> 
> > I am interested to know why he said that, is the 2.5 kernel 
> keeping track of
> > this internally now John ?
> 
> See above.
> 
> Search the lkml archives for Rusty Russell's HOWTO on module reference
> counting in the new world
> 
> regards
> john
> 
> -- 
> "Saying that taste is just personal preference is a good way 
> to prevent
> disputes. The trouble is, it's not true."
> 	- Paul Graham
> 
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux