aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-06-27 15:54:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-06-28 15:49:27 -0400
commitd17540c61bc7b0c7be45d0d2b6244ddbc9ba6aee (patch)
tree7a0255eeb6990caafd5b6cb2fdf7789aef90c259
parent4f6bb246f69443549fbbd0f2abaf863243cb35e9 (diff)
nfs: refactor "need_mount" code out of nfs_try_mount
This looks like pointless refactoring for now, but we'll flesh out the need_mount case a little more in a later patch. Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/super.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2d7525fbcf25..afeee810f453 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1759,21 +1759,29 @@ static int nfs_request_mount(struct nfs_parsed_mount_data *args,
1759 return nfs_select_flavor(args, &request); 1759 return nfs_select_flavor(args, &request);
1760} 1760}
1761 1761
1762static struct nfs_server *nfs_try_mount_request(struct nfs_mount_info *mount_info,
1763 struct nfs_subversion *nfs_mod)
1764{
1765 int status;
1766
1767 status = nfs_request_mount(mount_info->parsed, mount_info->mntfh);
1768 if (status)
1769 return ERR_PTR(status);
1770
1771 return nfs_mod->rpc_ops->create_server(mount_info, nfs_mod);
1772}
1773
1762struct dentry *nfs_try_mount(int flags, const char *dev_name, 1774struct dentry *nfs_try_mount(int flags, const char *dev_name,
1763 struct nfs_mount_info *mount_info, 1775 struct nfs_mount_info *mount_info,
1764 struct nfs_subversion *nfs_mod) 1776 struct nfs_subversion *nfs_mod)
1765{ 1777{
1766 int status;
1767 struct nfs_server *server; 1778 struct nfs_server *server;
1768 1779
1769 if (mount_info->parsed->need_mount) { 1780 if (mount_info->parsed->need_mount)
1770 status = nfs_request_mount(mount_info->parsed, mount_info->mntfh); 1781 server = nfs_try_mount_request(mount_info, nfs_mod);
1771 if (status) 1782 else
1772 return ERR_PTR(status); 1783 server = nfs_mod->rpc_ops->create_server(mount_info, nfs_mod);
1773 }
1774 1784
1775 /* Get a volume representation */
1776 server = nfs_mod->rpc_ops->create_server(mount_info, nfs_mod);
1777 if (IS_ERR(server)) 1785 if (IS_ERR(server))
1778 return ERR_CAST(server); 1786 return ERR_CAST(server);
1779 1787