Re: use counts for /proc modules

Bill Hawes (whawes@star.net)
Thu, 02 Oct 1997 15:02:08 -0400


Richard Henderson wrote:

> Hmm. I guess what you really need is to be able to determine if the
> thing is a module. Which might come in handy for other things as well.
>
> Have a look at what the scsi subsystem does with its
>
> if (rscsi_disks[target].device->host->hostt->module)
> __MOD_INC_USE_COUNT(rscsi_disks[target].device->host->hostt->module);
>
> It gets set via init_module in scsi_module.c, btw.

I'm assuming that whoever maintains each subsystem will decide whether
it can ever be used as a module, and if so will install a function
pointer in the proc_dir_entry structure before registering the
directory. The conditional compilation switch for the module can either
leave the function pointer as NULL, or just pass a stub function.

What's missing now is that there's no way for the VFS to let the module
(if any) know that its data structures are still in use. There needs to
be a standardized access point so that proc_iget can add a count when it
makes an inode, and delete_inode can decrement it.

Regards,
Bill