RE: NFS development questions.

chen, xiangping (chen_xiangping@EMC.com)
Thu, 8 Jul 1999 20:12:32 -0400


After tracing down the sys_mount, do_mount and read_super....
I found that in nfs client, server ip address is transfered to
nfs_read_super() in nfs/inode.c as a argument "void *data",
which I believe from
sys_mount( ... , void * data )

but in my fs client, the "data" is a null pointer, that's where the
error from. I am not sure how nfs client can get the data value.
Is there any special operation for nfs in calling sys_mount from
mount system call?

-----Original Message-----
From: ben fleis [mailto:lbf@umich.edu]
Sent: Thursday, July 08, 1999 5:17 PM
To: chen, xiangping
Cc: linux_net@vger.rutgers.edu; linux-kernel@vger.rutgers.edu
Subject: Re: NFS development questions.

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/