diff options
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index a88697ff19ef..f120be43d543 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -89,7 +89,7 @@ enum { | |||
89 | Opt_nfsvers, | 89 | Opt_nfsvers, |
90 | 90 | ||
91 | /* Mount options that take string arguments */ | 91 | /* Mount options that take string arguments */ |
92 | Opt_sec, Opt_proto, Opt_mountproto, | 92 | Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost, |
93 | Opt_addr, Opt_mountaddr, Opt_clientaddr, | 93 | Opt_addr, Opt_mountaddr, Opt_clientaddr, |
94 | 94 | ||
95 | /* Mount options that are ignored */ | 95 | /* Mount options that are ignored */ |
@@ -148,7 +148,7 @@ static match_table_t nfs_mount_option_tokens = { | |||
148 | { Opt_mountproto, "mountproto=%s" }, | 148 | { Opt_mountproto, "mountproto=%s" }, |
149 | { Opt_addr, "addr=%s" }, | 149 | { Opt_addr, "addr=%s" }, |
150 | { Opt_clientaddr, "clientaddr=%s" }, | 150 | { Opt_clientaddr, "clientaddr=%s" }, |
151 | { Opt_userspace, "mounthost=%s" }, | 151 | { Opt_mounthost, "mounthost=%s" }, |
152 | { Opt_mountaddr, "mountaddr=%s" }, | 152 | { Opt_mountaddr, "mountaddr=%s" }, |
153 | 153 | ||
154 | { Opt_err, NULL } | 154 | { Opt_err, NULL } |
@@ -974,6 +974,12 @@ static int nfs_parse_mount_options(char *raw, | |||
974 | goto out_nomem; | 974 | goto out_nomem; |
975 | mnt->client_address = string; | 975 | mnt->client_address = string; |
976 | break; | 976 | break; |
977 | case Opt_mounthost: | ||
978 | string = match_strdup(args); | ||
979 | if (string == NULL) | ||
980 | goto out_nomem; | ||
981 | mnt->mount_server.hostname = string; | ||
982 | break; | ||
977 | case Opt_mountaddr: | 983 | case Opt_mountaddr: |
978 | string = match_strdup(args); | 984 | string = match_strdup(args); |
979 | if (string == NULL) | 985 | if (string == NULL) |
@@ -1027,6 +1033,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1027 | { | 1033 | { |
1028 | struct sockaddr_in sin; | 1034 | struct sockaddr_in sin; |
1029 | int status; | 1035 | int status; |
1036 | char *hostname; | ||
1030 | 1037 | ||
1031 | if (args->mount_server.version == 0) { | 1038 | if (args->mount_server.version == 0) { |
1032 | if (args->flags & NFS_MOUNT_VER3) | 1039 | if (args->flags & NFS_MOUNT_VER3) |
@@ -1035,6 +1042,11 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1035 | args->mount_server.version = NFS_MNT_VERSION; | 1042 | args->mount_server.version = NFS_MNT_VERSION; |
1036 | } | 1043 | } |
1037 | 1044 | ||
1045 | if (args->mount_server.hostname) | ||
1046 | hostname = args->mount_server.hostname; | ||
1047 | else | ||
1048 | hostname = args->nfs_server.hostname; | ||
1049 | |||
1038 | /* | 1050 | /* |
1039 | * Construct the mount server's address. | 1051 | * Construct the mount server's address. |
1040 | */ | 1052 | */ |
@@ -1053,7 +1065,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1053 | */ | 1065 | */ |
1054 | status = nfs_mount((struct sockaddr *) &sin, | 1066 | status = nfs_mount((struct sockaddr *) &sin, |
1055 | sizeof(sin), | 1067 | sizeof(sin), |
1056 | args->nfs_server.hostname, | 1068 | hostname, |
1057 | args->nfs_server.export_path, | 1069 | args->nfs_server.export_path, |
1058 | args->mount_server.version, | 1070 | args->mount_server.version, |
1059 | args->mount_server.protocol, | 1071 | args->mount_server.protocol, |
@@ -1061,8 +1073,8 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1061 | if (status == 0) | 1073 | if (status == 0) |
1062 | return 0; | 1074 | return 0; |
1063 | 1075 | ||
1064 | dfprintk(MOUNT, "NFS: unable to mount server " NIPQUAD_FMT | 1076 | dfprintk(MOUNT, "NFS: unable to mount server %s, error %d", |
1065 | ", error %d\n", NIPQUAD(sin.sin_addr.s_addr), status); | 1077 | hostname, status); |
1066 | return status; | 1078 | return status; |
1067 | } | 1079 | } |
1068 | 1080 | ||
@@ -1468,6 +1480,7 @@ static int nfs_get_sb(struct file_system_type *fs_type, | |||
1468 | 1480 | ||
1469 | out: | 1481 | out: |
1470 | kfree(data.nfs_server.hostname); | 1482 | kfree(data.nfs_server.hostname); |
1483 | kfree(data.mount_server.hostname); | ||
1471 | return error; | 1484 | return error; |
1472 | 1485 | ||
1473 | out_err_nosb: | 1486 | out_err_nosb: |