Rogier Wolff wrote:
> 
> Kurt Garloff wrote:
> > > A simple test shows that the module count is working for
> > > the sg driver. So it seems as if open() calls to char
> > > devices do an auto module count increment. However I
> > > was unable to find the code that does this (e.g. no sign
> > > of it in fs/devices.c).
> > >
> > > Perhaps someone else could shed some light on this.
> >
> > No idea.
> 
> Hi,
> 
> FYI: The module counts are handled in a macro called something like
> get_fops.

Thanks Roger. So sg_open() is called from fs/devices.c chrdev_open() 
which also calls get_chrfops() which calls the macro fops_get()
defined in include/linux/fs.h ! There is also a fops_put() for
dealing with the decrement on close. It's a bit like a cryptic
crossword. I haven't changed the sg driver in lk 2.4 in the
last 6 months, but there have been about half a dozen changes
by others. It would be nice if we were alerted, especially
when code is removed, without comment.

Block devices take another route via fs/block_dev.c which doesn't
seem to involve calls to the macro fops_get() macro.

So that means osst might be double incrementing the
module count. It is not alone, Alan might like to
do a 'grep MOD_INC drivers/char/*.c' if he is
running out of things to do ...

Doug Gilbert

Dyslexia rules K.O. :-)

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to