Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d17540c6 authored by Jeff Layton's avatar Jeff Layton Committed by Trond Myklebust
Browse files

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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 4f6bb246
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -1759,21 +1759,29 @@ static int nfs_request_mount(struct nfs_parsed_mount_data *args,
	return nfs_select_flavor(args, &request);
}

struct dentry *nfs_try_mount(int flags, const char *dev_name,
			     struct nfs_mount_info *mount_info,
static struct nfs_server *nfs_try_mount_request(struct nfs_mount_info *mount_info,
					struct nfs_subversion *nfs_mod)
{
	int status;
	struct nfs_server *server;

	if (mount_info->parsed->need_mount) {
	status = nfs_request_mount(mount_info->parsed, mount_info->mntfh);
	if (status)
		return ERR_PTR(status);

	return nfs_mod->rpc_ops->create_server(mount_info, nfs_mod);
}

	/* Get a volume representation */
struct dentry *nfs_try_mount(int flags, const char *dev_name,
			     struct nfs_mount_info *mount_info,
			     struct nfs_subversion *nfs_mod)
{
	struct nfs_server *server;

	if (mount_info->parsed->need_mount)
		server = nfs_try_mount_request(mount_info, nfs_mod);
	else
		server = nfs_mod->rpc_ops->create_server(mount_info, nfs_mod);

	if (IS_ERR(server))
		return ERR_CAST(server);