Re: NFS development questions.

ben fleis (lbf@umich.edu)
Thu, 8 Jul 1999 17:16:33 -0400


On Thu, Jul 08, 1999 at 03:46:23PM -0400, chen, xiangping wrote:
> I plan to build a variant of NFS on Linux. First, I made a client
> by changing name symbols of NFS client and convert it as a loadable
> module. Actually it is a NFS client with a different name, but I
> could not mount it to a NFS server. It seems that the "mount" routine
> could not tell it is a NFS like device and get the file handle from
> the network, I read through the "strace" trace and drew the above
> conclusion.

> Can someone tell me how a "mount" for NFS works, how the system tell the
> device is a network address and invoke RPC routine. What's the path of
> related source code? How it is done to convert a NFS client from a loadable
> module to compiled in kernel? Besides convenience, is there any other
> consideration to move the NFS components inside kernel permanently?

NFS can already be modular or monolithic, so I'm confused by the first
sentence. Regardless, look at the file

[linux-src]/fs/super.c

and search for mount (including sys_mount and do_mount), and get the source
for the user-land mount program for your distribution and check through
that.

second, read RFC 1094 for NFSv2 and 1813 for NFSv3. If you find these
online, I think they contain links to the RFC for the mount protocol.

one slight annoyance i discovered for my project with doing the entire mount
phase in the kernel is performing name resolution --- although i haven't
asked here, i've yet to find a way to do 'gethostbyname' from the kernel
with fabricating my own udp packets. if the mount command was literally
just a trigger for the kernel, this could be a problem.

ben

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/