From owner-freebsd-hackers Mon Jul 7 11:48:32 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA00639 for hackers-outgoing; Mon, 7 Jul 1997 11:48:32 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id LAA00608 for ; Mon, 7 Jul 1997 11:48:17 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA18139; Mon, 7 Jul 1997 11:43:17 -0700 From: Terry Lambert Message-Id: <199707071843.LAA18139@phaeton.artisoft.com> Subject: Re: NFS locking, was: Re: NFS V3 is it stable? To: lederer@bonn-online.com (Sebastian Lederer) Date: Mon, 7 Jul 1997 11:43:17 -0700 (MST) Cc: terry@lambert.org, freebsd-hackers@FreeBSD.ORG In-Reply-To: <33C129B4.41C67EA6@bonn-online.com> from "Sebastian Lederer" at Jul 7, 97 07:39:00 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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.