-
NFS vnode?
Hi,
I have a very naive question.
Suppose I have a machine that has mounted two remote directories each
located on a separate NFS file server.
Now I am trying to figure out which layer on the client machine (VFS or
NFS) stores information such as IP address, port number so that the NFS
client in the kernel can send RPC to the approporiate file server.
In other words, assuming that I have all files already mounted, how
does the NFS client figure out which file server to contact (say for
lookup)? Which data structure is used to store this information?
Thanks in advance.
-
Re: NFS vnode?
In case anyone is interested to know, most likely I have found the
answer.
It is in the NFS superblock. I found the following line in nfs_fs.h
[...]
#define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server)
[...]
Which means every inode points to super block which points to nfs
superblock, which stores the server's IP address and stuff.
-
Re: NFS vnode?
On 28 Apr 2005 12:30:16 -0700, "fantoosh" <fantoosh@hotmail.com>
wrote:
[color=blue]
>In case anyone is interested to know, most likely I have found the
>answer.
>
>It is in the NFS superblock. I found the following line in nfs_fs.h
>[...]
>#define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server)
>[...]
>
>Which means every inode points to super block which points to nfs
>superblock, which stores the server's IP address and stuff.[/color]
Now that is interesting. I had thought that the OS read the
/etc/mnttab file system for that info, using NIS or DNS to resolve
IP's I guess technicaly it only stores the IP but displays the name
for us humans). Whenever a file system is mounted the kernel drops
the entry into mnttab and just references that for server contact.
At least that's what I thought it did....
~F