Skip to contentSkip to conversation

nfs mounting operation

DISCUSSION Mohit Katiyar 2 participants 4 messages Sep 28, 2006 – Sep 29, 2006 VFS

lore
Share & tools
lore
#0 lore raw

Hi all,

I am new to the NFS filesystem. When we perfrom a nfs mount the nfs_getattr function is called. I would like to know why this getattr function is called and from which function in the vfs layer. I think it comes from vfs_stat_fd function but what are the parameters passed to it for calling get_attribute. Basically whose attributes are being searched??
The same case with unmounting operation. why this getattr function is called and from where in vfs layer it is invoked?
I am using linux-2.6.15.

TIA
Mohit Katiyar

#1 lore raw
Quoted 11 lines · Mohit Katiyar

Hi all,

I am new to the NFS filesystem. When we perfrom a nfs mount the nfs_getattr function is called. I would like to know why this getattr function is called and from which function in the vfs layer. I think it comes from vfs_stat_fd function but what are the parameters passed to it for calling get_attribute. Basically whose attributes are being searched??
The same case with unmounting operation. why this getattr function is called and from where in vfs layer it is invoked?
I am using linux-2.6.15.

The over the wire GETATTR function is used during mounting to get the initial set of attributes for the root of the mounted file system.

From time to time, GETATTR is also used to validate the attributes and cached resources associated with entities on the mounted file system.

ps

#2 lore raw

Hi
Thanks for the reply.
But i am really confused about the nfs superblock and root directory maintainance.
For example
If we mount two partition as shown below

mount -t nfs host1:/export/dir1 /mnt/dir1/
mount -t nfs host2:/export/dir2 /mnt/dir2/

Then will there be two nfs superbocks created one per each mount? If not and if there is only one nfs superblock then s_root entry of the nfs superbolck will point to which root directory(of the first or second mount).

Quoted 21 lines · Peter Staubach
Quoted 11 lines · Mohit Katiyar

Hi all,

I am new to the NFS filesystem. When we perfrom a nfs mount the nfs_getattr function is called. I would like to know why this getattr function is called and from which function in the vfs layer. I think it comes from vfs_stat_fd function but what are the parameters passed to it for calling get_attribute. Basically whose attributes are being searched??
The same case with unmounting operation. why this getattr function is called and from where in vfs layer it is invoked?
I am using linux-2.6.15.

The over the wire GETATTR function is used during mounting to get the initial set of attributes for the root of the mounted file system.

From time to time, GETATTR is also used to validate the attributes and
cached resources associated with entities on the mounted file system.

ps

#3 lore raw
Quoted 7 lines · Mohit Katiyar

Hi
Thanks for the reply.
But i am really confused about the nfs superblock and root directory maintainance.
For example
If we mount two partition as shown below

Quoted 7 lines

mount -t nfs host1:/export/dir1 /mnt/dir1/
mount -t nfs host2:/export/dir2 /mnt/dir2/

Then will there be two nfs superbocks created one per each mount? If not and if there is only one nfs superblock then s_root entry of the nfs superbolck will point to which root directory(of the first or second mount).

There will be two superblocks created, one per mount, assuming that host1 and host2 are different systems.

I would suggest studying the code at this point.

ps