From owner-freebsd-hackers Tue Aug 3 14: 0:30 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cygnus.rush.net (cygnus.rush.net [209.45.245.133]) by hub.freebsd.org (Postfix) with ESMTP id 71B80150AD for ; Tue, 3 Aug 1999 14:00:13 -0700 (PDT) (envelope-from bright@rush.net) Received: from localhost (bright@localhost) by cygnus.rush.net (8.9.3/8.9.3) with SMTP id RAA01022; Tue, 3 Aug 1999 17:02:54 -0400 (EDT) Date: Tue, 3 Aug 1999 17:02:53 -0400 (EDT) From: Alfred Perlstein To: Assar Westerlund Cc: hackers@FreeBSD.ORG Subject: Re: more NFS questions, why is the VFS_FHTOVP weird? In-Reply-To: <5lwvvdysat.fsf@assaris.sics.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 3 Aug 1999, Assar Westerlund wrote: > Alfred Perlstein writes: > > > > * At this point, this should never happen > > */ > > /* ARGSUSED */ > > static int > > nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) > > register struct mount *mp; > > struct fid *fhp; > > struct sockaddr *nam; > > struct vnode **vpp; > > int *exflagsp; > > struct ucred **credanonp; > > { > > > > return (EINVAL); > > } > > > > ok, now if you look at the first piece of code it obviously > > fails if nfsrv_fhtovp fails, and nfsrv_fhtovp fails if VFS_FHTOVP > > fails... > > > > so how does NFS work? where is this magic function? > > The NFS server is calling the FHTOVP function of the exported file > system. You're looking at the FHTOVP function for the NFS file system > itself. Look for example at ffs_fhtovp and ufs_check_export. ah thank you it makes more sense now, i'm working on patches to make this more like netbsd's way. > > the macro VFS_FHTOVP is defined in mount.h: > > > > #define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \ > > (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED) > > I do think that checking for what file systems are exported has no > place in FHTOVP and this should probably be rewritten similar to the > way it has recently been done in NetBSD, namely with a new vfs > operation: > > int (*vfs_checkexp) __P((struct mount *mp, struct mbuf *nam, > int *extflagsp, struct ucred **credanonp)); > > And they have also added fhopen and other syscalls that take file > handles instead of file names. I just booted my NetBSD box and saw the implemented functions. :) > > btw, since this seems to work... is it ok to pass in a NULL > > sockaddr *? (nam) > > I think that nam == NULL means the default export list which doesn't > sound as what you want do do? no it's not what I want to do, thank you for the help. -Alfred Perlstein - [bright@rush.net|bright@wintelcom.net] systems administrator and programmer Wintelcom - http://www.wintelcom.net/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message