diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-12-23 15:21:35 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-12-23 15:21:35 -0500 |
commit | c5d120f8e8b464368a7dcb038dc5c077d234d10a (patch) | |
tree | 28ec4ffebf3ebe0cdd1ed9c5ba174457b5960e32 /fs/nfs/super.c | |
parent | 146ec944bbd31d241a44a00518b054fb01921d22 (diff) |
NFS: introduce nfs_mount_info struct for calling nfs_mount()
Clean up: convert nfs_mount() to take a single data structure argument to make
it simpler to add more arguments.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index f48db679a1c6..2b0c8e132b54 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1329,8 +1329,13 @@ out_security_failure: | |||
1329 | static int nfs_try_mount(struct nfs_parsed_mount_data *args, | 1329 | static int nfs_try_mount(struct nfs_parsed_mount_data *args, |
1330 | struct nfs_fh *root_fh) | 1330 | struct nfs_fh *root_fh) |
1331 | { | 1331 | { |
1332 | struct sockaddr *sap = (struct sockaddr *)&args->mount_server.address; | 1332 | struct nfs_mount_request request = { |
1333 | char *hostname; | 1333 | .sap = (struct sockaddr *) |
1334 | &args->mount_server.address, | ||
1335 | .dirpath = args->nfs_server.export_path, | ||
1336 | .protocol = args->mount_server.protocol, | ||
1337 | .fh = root_fh, | ||
1338 | }; | ||
1334 | int status; | 1339 | int status; |
1335 | 1340 | ||
1336 | if (args->mount_server.version == 0) { | 1341 | if (args->mount_server.version == 0) { |
@@ -1339,42 +1344,38 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1339 | else | 1344 | else |
1340 | args->mount_server.version = NFS_MNT_VERSION; | 1345 | args->mount_server.version = NFS_MNT_VERSION; |
1341 | } | 1346 | } |
1347 | request.version = args->mount_server.version; | ||
1342 | 1348 | ||
1343 | if (args->mount_server.hostname) | 1349 | if (args->mount_server.hostname) |
1344 | hostname = args->mount_server.hostname; | 1350 | request.hostname = args->mount_server.hostname; |
1345 | else | 1351 | else |
1346 | hostname = args->nfs_server.hostname; | 1352 | request.hostname = args->nfs_server.hostname; |
1347 | 1353 | ||
1348 | /* | 1354 | /* |
1349 | * Construct the mount server's address. | 1355 | * Construct the mount server's address. |
1350 | */ | 1356 | */ |
1351 | if (args->mount_server.address.ss_family == AF_UNSPEC) { | 1357 | if (args->mount_server.address.ss_family == AF_UNSPEC) { |
1352 | memcpy(sap, &args->nfs_server.address, | 1358 | memcpy(request.sap, &args->nfs_server.address, |
1353 | args->nfs_server.addrlen); | 1359 | args->nfs_server.addrlen); |
1354 | args->mount_server.addrlen = args->nfs_server.addrlen; | 1360 | args->mount_server.addrlen = args->nfs_server.addrlen; |
1355 | } | 1361 | } |
1362 | request.salen = args->mount_server.addrlen; | ||
1356 | 1363 | ||
1357 | /* | 1364 | /* |
1358 | * autobind will be used if mount_server.port == 0 | 1365 | * autobind will be used if mount_server.port == 0 |
1359 | */ | 1366 | */ |
1360 | nfs_set_port(sap, args->mount_server.port); | 1367 | nfs_set_port(request.sap, args->mount_server.port); |
1361 | 1368 | ||
1362 | /* | 1369 | /* |
1363 | * Now ask the mount server to map our export path | 1370 | * Now ask the mount server to map our export path |
1364 | * to a file handle. | 1371 | * to a file handle. |
1365 | */ | 1372 | */ |
1366 | status = nfs_mount(sap, | 1373 | status = nfs_mount(&request); |
1367 | args->mount_server.addrlen, | ||
1368 | hostname, | ||
1369 | args->nfs_server.export_path, | ||
1370 | args->mount_server.version, | ||
1371 | args->mount_server.protocol, | ||
1372 | root_fh); | ||
1373 | if (status == 0) | 1374 | if (status == 0) |
1374 | return 0; | 1375 | return 0; |
1375 | 1376 | ||
1376 | dfprintk(MOUNT, "NFS: unable to mount server %s, error %d\n", | 1377 | dfprintk(MOUNT, "NFS: unable to mount server %s, error %d\n", |
1377 | hostname, status); | 1378 | request.hostname, status); |
1378 | return status; | 1379 | return status; |
1379 | } | 1380 | } |
1380 | 1381 | ||