From owner-svn-src-all@FreeBSD.ORG Fri May 6 21:06:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3889106564A; Fri, 6 May 2011 21:06:08 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 3868F8FC16; Fri, 6 May 2011 21:06:08 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAIVhxE2DaFvO/2dsb2JhbACEU6JCiHGrGpB5gSqDXoEBBI9YhxuHVQ X-IronPort-AV: E=Sophos;i="4.64,328,1301889600"; d="scan'208";a="119901669" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 06 May 2011 17:06:07 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 31947793A7; Fri, 6 May 2011 17:06:07 -0400 (EDT) Date: Fri, 6 May 2011 17:06:07 -0400 (EDT) From: Rick Macklem To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Message-ID: <1202195776.1136829.1304715967146.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <8662pnzicj.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: svn-src-head@freebsd.org, Rick Macklem , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 21:06:09 -0000 > Rick Macklem 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