Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2011 17:06:07 -0400 (EDT)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
Cc:        svn-src-head@freebsd.org, Rick Macklem <rmacklem@FreeBSD.org>, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek <pjd@FreeBSD.org>
Subject:   Re: 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
Message-ID:  <1202195776.1136829.1304715967146.JavaMail.root@erie.cs.uoguelph.ca>
In-Reply-To: <8662pnzicj.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
> Rick Macklem <rmacklem@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1202195776.1136829.1304715967146.JavaMail.root>