Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79642
b: refs/heads/master
c: 3383203
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jan 30, 2008
1 parent 3125e3a commit 917f9c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6677d09513e35ac2f38d3a8c8a26fbd7bbcef192
refs/heads/master: 338320345b40eb7c63592f40d25cbd58ccf99548
23 changes: 18 additions & 5 deletions trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ enum {
Opt_nfsvers,

/* Mount options that take string arguments */
Opt_sec, Opt_proto, Opt_mountproto,
Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost,
Opt_addr, Opt_mountaddr, Opt_clientaddr,

/* Mount options that are ignored */
Expand Down Expand Up @@ -148,7 +148,7 @@ static match_table_t nfs_mount_option_tokens = {
{ Opt_mountproto, "mountproto=%s" },
{ Opt_addr, "addr=%s" },
{ Opt_clientaddr, "clientaddr=%s" },
{ Opt_userspace, "mounthost=%s" },
{ Opt_mounthost, "mounthost=%s" },
{ Opt_mountaddr, "mountaddr=%s" },

{ Opt_err, NULL }
Expand Down Expand Up @@ -974,6 +974,12 @@ static int nfs_parse_mount_options(char *raw,
goto out_nomem;
mnt->client_address = string;
break;
case Opt_mounthost:
string = match_strdup(args);
if (string == NULL)
goto out_nomem;
mnt->mount_server.hostname = string;
break;
case Opt_mountaddr:
string = match_strdup(args);
if (string == NULL)
Expand Down Expand Up @@ -1027,6 +1033,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
{
struct sockaddr_in sin;
int status;
char *hostname;

if (args->mount_server.version == 0) {
if (args->flags & NFS_MOUNT_VER3)
Expand All @@ -1035,6 +1042,11 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
args->mount_server.version = NFS_MNT_VERSION;
}

if (args->mount_server.hostname)
hostname = args->mount_server.hostname;
else
hostname = args->nfs_server.hostname;

/*
* Construct the mount server's address.
*/
Expand All @@ -1053,16 +1065,16 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
*/
status = nfs_mount((struct sockaddr *) &sin,
sizeof(sin),
args->nfs_server.hostname,
hostname,
args->nfs_server.export_path,
args->mount_server.version,
args->mount_server.protocol,
root_fh);
if (status == 0)
return 0;

dfprintk(MOUNT, "NFS: unable to mount server " NIPQUAD_FMT
", error %d\n", NIPQUAD(sin.sin_addr.s_addr), status);
dfprintk(MOUNT, "NFS: unable to mount server %s, error %d",
hostname, status);
return status;
}

Expand Down Expand Up @@ -1468,6 +1480,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,

out:
kfree(data.nfs_server.hostname);
kfree(data.mount_server.hostname);
return error;

out_err_nosb:
Expand Down

0 comments on commit 917f9c1

Please sign in to comment.