Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 1997 11:43:17 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        lederer@bonn-online.com (Sebastian Lederer)
Cc:        terry@lambert.org, freebsd-hackers@FreeBSD.ORG
Subject:   Re: NFS locking, was: Re: NFS V3 is it stable?
Message-ID:  <199707071843.LAA18139@phaeton.artisoft.com>
In-Reply-To: <33C129B4.41C67EA6@bonn-online.com> from "Sebastian Lederer" at Jul 7, 97 07:39:00 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I have now started exploring the vfs/nfs kernel code.
> It appears to me that maybe some things we need for the
> fcntl(F_CNVT) call are already there. Namely,
> the nfsrv_fhtovp() function in nfs/nfs_subs.c
> converts a file handle (fhandle_t, not struct fid) into a vnode.
> So one could possibly use this function (or a modified version)
> to create the vnode from the handle, use falloc() to create an open
> file and then tie the vnode to the file struct.
> Question is, is the fhandle_t the same as the nfs file handle?

I don't know.  From a preliminary discussion with Andrew, I didn't
think so, so I didn't implement the F_CNVT handle-to-fd fcntl()
conversion call.

Before I get jumped on again: I intentionally chose the SunOS 4.x
fcntl() model instead of the SVR4 nfssvc() model *specifically*
because I was exposed to the USL source code for a long period
of time, and I didn't want any possibility of "contamination
claims" haunting the implementation.  Also, SunOS 4.x is the
NFS reference implementation.


Note that for NFS to be a loadable module, there must be a call
through the VOP for the conversion instead of a call directly to
the fuction.  See the lease handling callback registration for
details (note: I am not happy with this implementation of the
lease interface, specifically because of operations in progress
prior to registration completing after registration -- they can
result in a catastrophic failure because there is no "in progress"
tag to prevent the failure).


> This is only guesswork, since I am absolutely no kernel programming
> expert.
> Am I thinking in the right direction?

Yes.  These are the conversion functions which will need to be
called, oncce the handle is converted from "wire representation
with validator" to "validated internal representation".

I seriously suggest contacting Andrew directly on this question;
he is the person who I would have to contact for the same information.


					Regards,
					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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