Re: [RFC] put symbolic links between drivers and modules in the sysfs tree

On Mon, Sep 20, 2004 at 01:29:44PM -0400, James Bottomley wrote:> This functionality is essential for us to work out which drivers are> supplied by which modules. We use this in turn to work out which> modules are necessary to find the root device (and hence what> initrd/initramfs needs to insert).> > If you look at debian at the moment, it uses a huge mapping table on> /proc/scsi/* to do this. If we implement the sysfs feature, we can> simply go from /sys/block/<device> to the actual device to the driver> and then to the module with no need of any fixed tables.> > The code is a first cut and introduces two new module APIs:> module_add_driver() and module_remove_driver(). We need this because> the generic device model driver has no current knowledge of modules. We> could enhance it to have a struct module * in struct device_driver, but> once we have the sysfs links which this patch provides, there didn't> seem to be a compelling reason to add it to struct device_driver.> > Comments?

I like it. But I do think that this should be moved into the drivercore, so I added a "struct module *" to "struct device_driver". Here'sthe patch that I just applied to my trees, based on yours. It is onlythe core changes (and yes, I did fix up the location of the functions inthe module.h file and fixed the bug when modules were not configuredin.) I'll post my usb core change after this, to show you how USB canbe hooked up to it. I'll let you figure out what the best way to handlethe scsi code would be.

thanks again for the patch.

greg k-h

---------

Put symbolic links between drivers and modules in the sysfs tree

This functionality is essential for us to work out which drivers aresupplied by which modules. We use this in turn to work out whichmodules are necessary to find the root device (and hence whatinitrd/initramfs needs to insert).

If you look at debian at the moment, it uses a huge mapping table on/proc/scsi/* to do this. If we implement the sysfs feature, we cansimply go from /sys/block/<device> to the actual device to the driverand then to the module with no need of any fixed tables.Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>

#ifdef CONFIG_MODVERSIONS /* Generate the signature for struct module here, too, for modversions. */-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at http://vger.kernel.org/majordomo-info.htmlPlease read the FAQ at http://www.tux.org/lkml/