linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bjschuma@netapp.com
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, Bryan Schumaker <bjschuma@netapp.com>
Subject: [PATCH v4 01/14] NFS: Rename nfs4_proc_get_root()
Date: Thu, 10 May 2012 15:07:30 -0400	[thread overview]
Message-ID: <1336676863-9698-2-git-send-email-bjschuma@netapp.com> (raw)
In-Reply-To: <1336676863-9698-1-git-send-email-bjschuma@netapp.com>

From: Bryan Schumaker <bjschuma@netapp.com>

This function is really getting the root filehandle and not the root
dentry of the filesystem.  I also removed the rpc_ops lookup from
nfs4_get_rootfh() under the assumption that if we reach this function
then we already know we are using NFS v4.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfs/getroot.c  |    2 +-
 fs/nfs/nfs4_fs.h  |    1 +
 fs/nfs/nfs4proc.c |    6 +++---
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 4ca6f5c..8a0f33e 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -150,7 +150,7 @@ int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh)
 		goto out;
 
 	/* Start by getting the root filehandle from the server */
-	ret = server->nfs_client->rpc_ops->getroot(server, mntfh, &fsinfo);
+	ret = nfs4_proc_get_rootfh(server, mntfh, &fsinfo);
 	if (ret < 0) {
 		dprintk("nfs4_get_rootfh: getroot error = %d\n", -ret);
 		goto out;
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 97365b0..edeef71 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -214,6 +214,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *,
 /* nfs4proc.c */
 extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, struct rpc_cred *, struct nfs4_setclientid_res *);
 extern int nfs4_proc_setclientid_confirm(struct nfs_client *, struct nfs4_setclientid_res *arg, struct rpc_cred *);
+extern int nfs4_proc_get_rootfh(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *);
 extern int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred);
 extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *);
 extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 98eb48d..69212d2 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2345,8 +2345,8 @@ static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
 /*
  * get the file handle for the "/" directory on the server
  */
-static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
-			      struct nfs_fsinfo *info)
+int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle,
+			 struct nfs_fsinfo *info)
 {
 	int minor_version = server->nfs_client->cl_minorversion;
 	int status = nfs4_lookup_root(server, fhandle, info);
@@ -6539,7 +6539,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
 	.dir_inode_ops	= &nfs4_dir_inode_operations,
 	.file_inode_ops	= &nfs4_file_inode_operations,
 	.file_ops	= &nfs4_file_operations,
-	.getroot	= nfs4_proc_get_root,
+	.getroot	= nfs4_proc_get_rootfh,
 	.submount	= nfs4_submount,
 	.getattr	= nfs4_proc_getattr,
 	.setattr	= nfs4_proc_setattr,
-- 
1.7.10.1


  reply	other threads:[~2012-05-10 19:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 19:07 [PATCH v4 00/14] Clean up mount functions bjschuma
2012-05-10 19:07 ` bjschuma [this message]
2012-05-10 19:07 ` [PATCH v4 02/14] NFS: Create a single nfs_get_root() bjschuma
2012-05-10 19:07 ` [PATCH v4 03/14] NFS: Don't pass mount data to nfs_fscache_get_super_cookie() bjschuma
2012-05-10 19:07 ` [PATCH v4 04/14] NFS: Remove NFS4_MOUNT_UNSHARED bjschuma
2012-05-10 19:07 ` [PATCH v4 05/14] NFS: Create a common fs_mount() function bjschuma
2012-05-10 19:07 ` [PATCH v4 06/14] NFS: Create a common xdev_mount() function bjschuma
2012-05-10 19:07 ` [PATCH v4 07/14] NFS: Use nfs_fs_mount_common() for xdev mounts bjschuma
2012-05-10 19:07 ` [PATCH v4 08/14] NFS: Use nfs_fs_mount_common() for remote referral mounts bjschuma
2012-05-10 19:07 ` [PATCH v4 09/14] NFS: Let mount data parsing set the NFS version bjschuma
2012-05-10 19:07 ` [PATCH v4 10/14] NFS: Create a new nfs_try_mount() bjschuma
2012-05-10 19:07 ` [PATCH v4 11/14] NFS: Create a single function for text mount data bjschuma
2012-05-10 19:07 ` [PATCH v4 12/14] NFS: Create a single nfs_validate_mount_data() function bjschuma
2012-05-10 19:07 ` [PATCH v4 13/14] NFS: Allocate parsed mount data directly to the nfs_mount_info structure bjschuma
2012-05-10 19:07 ` [PATCH v4 14/14] NFS: Pass mntfh as part of " bjschuma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336676863-9698-2-git-send-email-bjschuma@netapp.com \
    --to=bjschuma@netapp.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).