NFS: Add a super_block backpointer to the nfs_server struct
authorChuck Lever <chuck.lever@oracle.com>
Thu, 17 Oct 2013 18:12:56 +0000 (14:12 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 28 Oct 2013 19:24:26 +0000 (15:24 -0400)
NFS_SB() returns the pointer to an nfs_server struct, given a
pointer to a super_block.  But we have no way to go back the other
way.

Add a super_block backpointer field so that, given an nfs_server
struct, it is easy to get to the filesystem's root dentry.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/super.c
include/linux/nfs_fs_sb.h

index 3f5a7a85c9c2604d5ca9a7f720e7db551731c1ee..e26647be69ce34595f42802988f150781d797d07 100644 (file)
@@ -2534,6 +2534,7 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server,
                        mntroot = ERR_PTR(error);
                        goto error_splat_bdi;
                }
+               server->super = s;
        }
 
        if (!s->s_root) {
index f9c0a6cb41e945e148db3d4c927f84e25e76c33b..46b0cb4bee099b6fadcbf2671fd31cdd7af70cbb 100644 (file)
@@ -148,6 +148,7 @@ struct nfs_server {
        __u64                   maxfilesize;    /* maximum file size */
        struct timespec         time_delta;     /* smallest time granularity */
        unsigned long           mount_time;     /* when this fs was mounted */
+       struct super_block      *super;         /* VFS super block */
        dev_t                   s_dev;          /* superblock dev numbers */
 
 #ifdef CONFIG_NFS_FSCACHE