svn commit: r221124 - in head: . sbin/mount sbin/mount_nfs sys/amd64/conf sys/fs/nfsclient sys/i386/conf sys/ia64/conf sys/nfsclient sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

Rick Macklem rmacklem at uoguelph.ca
Fri May 6 21:06:09 UTC 2011


> Rick Macklem <rmacklem at uoguelph.ca> writes:
> > My problem is that I don't know how to deal with two modules with
> > the same name.
> 
> Why do they have to have the same name? All that matters is the fstype
> and the sysctls. Just make sure that the auto-load logic loads the new
> stack and not the old one if neither is loaded already.
> 
Well, the main auto-load logic is the (n)mount(2) syscall and it does
a vfs_byname_kld(fstype, td, errp), which calls
kern_kldload(td, fstype, &fileid) to load the module.
The argument is the "fstype", so that is what is used to find/load
the module. The way sys/nfsclient is set up (and I think this is the
norm for file systems), the module name is the fstype name, because

VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK);
(There is a DECLARE_MODULE() in this macro and it uses the 2nd arg.
 to set the module name, same as the fstype name. Just take a look
 at the VFS_SET() macro in sys/mount.h.)

defines the module name as the 2nd argument, which is also the fstype.
(You can give it another "name" via DECLARE_MODULE(), although I'm not
 sure if that it considered correct to do, but it will be the "fstype"
 that the mount(2) syscall will use to try and load it.)

rick


More information about the svn-src-head mailing list