[PATCH/RFC v3 03/10] Store root dentry in server object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is needed for vfh migration/replication recovery and recovering
from FHEXPIRED returned during getattr. It will be used as
a starting point for dcache traversal.

Signed-off-by: Matthew Treinish <treinish@xxxxxxxxxxxxxxxxxx>
---
 fs/nfs/getroot.c          |    1 +
 fs/nfs/super.c            |    1 +
 include/linux/nfs_fs_sb.h |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 51ca63b..8d07346 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -255,6 +255,7 @@ struct dentry *nfs4_get_root(struct super_block *sb, struct nfs_fh *mntfh,
 		dprintk("nfs_get_root: get root dentry failed\n");
 		goto out;
 	}
+	server->rootdentry = dget(ret);
 
 	security_d_instantiate(ret, inode);
 	spin_lock(&ret->d_lock);
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 6c0be34e..0b26768 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2892,6 +2892,7 @@ static void nfs4_kill_super(struct super_block *sb)
 
 	dprintk("--> %s\n", __func__);
 	nfs_super_return_all_delegations(sb);
+	dput(server->rootdentry);
 	kill_anon_super(sb);
 	nfs_fscache_release_super_cookie(sb);
 	nfs_free_server(server);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 5993319..68155b1 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -154,6 +154,7 @@ struct nfs_server {
 	/* the following fields are protected by nfs_client->cl_lock */
 	struct rb_root		state_owners;
 #endif
+	struct dentry		*rootdentry;
 	struct ida		openowner_id;
 	struct ida		lockowner_id;
 	struct list_head	state_owners_lru;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux