diff options
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index bb0313ac9e1f..d6686f4786dc 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -75,6 +75,7 @@ enum { | |||
75 | Opt_acl, Opt_noacl, | 75 | Opt_acl, Opt_noacl, |
76 | Opt_rdirplus, Opt_nordirplus, | 76 | Opt_rdirplus, Opt_nordirplus, |
77 | Opt_sharecache, Opt_nosharecache, | 77 | Opt_sharecache, Opt_nosharecache, |
78 | Opt_resvport, Opt_noresvport, | ||
78 | 79 | ||
79 | /* Mount options that take integer arguments */ | 80 | /* Mount options that take integer arguments */ |
80 | Opt_port, | 81 | Opt_port, |
@@ -129,6 +130,8 @@ static const match_table_t nfs_mount_option_tokens = { | |||
129 | { Opt_nordirplus, "nordirplus" }, | 130 | { Opt_nordirplus, "nordirplus" }, |
130 | { Opt_sharecache, "sharecache" }, | 131 | { Opt_sharecache, "sharecache" }, |
131 | { Opt_nosharecache, "nosharecache" }, | 132 | { Opt_nosharecache, "nosharecache" }, |
133 | { Opt_resvport, "resvport" }, | ||
134 | { Opt_noresvport, "noresvport" }, | ||
132 | 135 | ||
133 | { Opt_port, "port=%u" }, | 136 | { Opt_port, "port=%u" }, |
134 | { Opt_rsize, "rsize=%u" }, | 137 | { Opt_rsize, "rsize=%u" }, |
@@ -512,7 +515,8 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss, | |||
512 | { NFS_MOUNT_NONLM, ",nolock", "" }, | 515 | { NFS_MOUNT_NONLM, ",nolock", "" }, |
513 | { NFS_MOUNT_NOACL, ",noacl", "" }, | 516 | { NFS_MOUNT_NOACL, ",noacl", "" }, |
514 | { NFS_MOUNT_NORDIRPLUS, ",nordirplus", "" }, | 517 | { NFS_MOUNT_NORDIRPLUS, ",nordirplus", "" }, |
515 | { NFS_MOUNT_UNSHARED, ",nosharecache", ""}, | 518 | { NFS_MOUNT_UNSHARED, ",nosharecache", "" }, |
519 | { NFS_MOUNT_NORESVPORT, ",noresvport", "" }, | ||
516 | { 0, NULL, NULL } | 520 | { 0, NULL, NULL } |
517 | }; | 521 | }; |
518 | const struct proc_nfs_info *nfs_infop; | 522 | const struct proc_nfs_info *nfs_infop; |
@@ -1033,6 +1037,12 @@ static int nfs_parse_mount_options(char *raw, | |||
1033 | case Opt_nosharecache: | 1037 | case Opt_nosharecache: |
1034 | mnt->flags |= NFS_MOUNT_UNSHARED; | 1038 | mnt->flags |= NFS_MOUNT_UNSHARED; |
1035 | break; | 1039 | break; |
1040 | case Opt_resvport: | ||
1041 | mnt->flags &= ~NFS_MOUNT_NORESVPORT; | ||
1042 | break; | ||
1043 | case Opt_noresvport: | ||
1044 | mnt->flags |= NFS_MOUNT_NORESVPORT; | ||
1045 | break; | ||
1036 | 1046 | ||
1037 | /* | 1047 | /* |
1038 | * options that take numeric values | 1048 | * options that take numeric values |
@@ -1327,8 +1337,14 @@ out_security_failure: | |||
1327 | static int nfs_try_mount(struct nfs_parsed_mount_data *args, | 1337 | static int nfs_try_mount(struct nfs_parsed_mount_data *args, |
1328 | struct nfs_fh *root_fh) | 1338 | struct nfs_fh *root_fh) |
1329 | { | 1339 | { |
1330 | struct sockaddr *sap = (struct sockaddr *)&args->mount_server.address; | 1340 | struct nfs_mount_request request = { |
1331 | char *hostname; | 1341 | .sap = (struct sockaddr *) |
1342 | &args->mount_server.address, | ||
1343 | .dirpath = args->nfs_server.export_path, | ||
1344 | .protocol = args->mount_server.protocol, | ||
1345 | .fh = root_fh, | ||
1346 | .noresvport = args->flags & NFS_MOUNT_NORESVPORT, | ||
1347 | }; | ||
1332 | int status; | 1348 | int status; |
1333 | 1349 | ||
1334 | if (args->mount_server.version == 0) { | 1350 | if (args->mount_server.version == 0) { |
@@ -1337,42 +1353,38 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1337 | else | 1353 | else |
1338 | args->mount_server.version = NFS_MNT_VERSION; | 1354 | args->mount_server.version = NFS_MNT_VERSION; |
1339 | } | 1355 | } |
1356 | request.version = args->mount_server.version; | ||
1340 | 1357 | ||
1341 | if (args->mount_server.hostname) | 1358 | if (args->mount_server.hostname) |
1342 | hostname = args->mount_server.hostname; | 1359 | request.hostname = args->mount_server.hostname; |
1343 | else | 1360 | else |
1344 | hostname = args->nfs_server.hostname; | 1361 | request.hostname = args->nfs_server.hostname; |
1345 | 1362 | ||
1346 | /* | 1363 | /* |
1347 | * Construct the mount server's address. | 1364 | * Construct the mount server's address. |
1348 | */ | 1365 | */ |
1349 | if (args->mount_server.address.ss_family == AF_UNSPEC) { | 1366 | if (args->mount_server.address.ss_family == AF_UNSPEC) { |
1350 | memcpy(sap, &args->nfs_server.address, | 1367 | memcpy(request.sap, &args->nfs_server.address, |
1351 | args->nfs_server.addrlen); | 1368 | args->nfs_server.addrlen); |
1352 | args->mount_server.addrlen = args->nfs_server.addrlen; | 1369 | args->mount_server.addrlen = args->nfs_server.addrlen; |
1353 | } | 1370 | } |
1371 | request.salen = args->mount_server.addrlen; | ||
1354 | 1372 | ||
1355 | /* | 1373 | /* |
1356 | * autobind will be used if mount_server.port == 0 | 1374 | * autobind will be used if mount_server.port == 0 |
1357 | */ | 1375 | */ |
1358 | nfs_set_port(sap, args->mount_server.port); | 1376 | nfs_set_port(request.sap, args->mount_server.port); |
1359 | 1377 | ||
1360 | /* | 1378 | /* |
1361 | * Now ask the mount server to map our export path | 1379 | * Now ask the mount server to map our export path |
1362 | * to a file handle. | 1380 | * to a file handle. |
1363 | */ | 1381 | */ |
1364 | status = nfs_mount(sap, | 1382 | status = nfs_mount(&request); |
1365 | args->mount_server.addrlen, | ||
1366 | hostname, | ||
1367 | args->nfs_server.export_path, | ||
1368 | args->mount_server.version, | ||
1369 | args->mount_server.protocol, | ||
1370 | root_fh); | ||
1371 | if (status == 0) | 1383 | if (status == 0) |
1372 | return 0; | 1384 | return 0; |
1373 | 1385 | ||
1374 | dfprintk(MOUNT, "NFS: unable to mount server %s, error %d\n", | 1386 | dfprintk(MOUNT, "NFS: unable to mount server %s, error %d\n", |
1375 | hostname, status); | 1387 | request.hostname, status); |
1376 | return status; | 1388 | return status; |
1377 | } | 1389 | } |
1378 | 1390 | ||
@@ -2419,7 +2431,7 @@ static void nfs4_kill_super(struct super_block *sb) | |||
2419 | { | 2431 | { |
2420 | struct nfs_server *server = NFS_SB(sb); | 2432 | struct nfs_server *server = NFS_SB(sb); |
2421 | 2433 | ||
2422 | nfs_return_all_delegations(sb); | 2434 | nfs_super_return_all_delegations(sb); |
2423 | kill_anon_super(sb); | 2435 | kill_anon_super(sb); |
2424 | 2436 | ||
2425 | nfs4_renewd_prepare_shutdown(server); | 2437 | nfs4_renewd_prepare_shutdown(server); |