aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/mount_clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/mount_clnt.c')
-rw-r--r--fs/nfs/mount_clnt.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index 086a6830d785..ca905a5bb1ba 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -29,47 +29,43 @@ struct mnt_fhstatus {
29 29
30/** 30/**
31 * nfs_mount - Obtain an NFS file handle for the given host and path 31 * nfs_mount - Obtain an NFS file handle for the given host and path
32 * @addr: pointer to server's address 32 * @info: pointer to mount request arguments
33 * @len: size of server's address
34 * @hostname: name of server host, or NULL
35 * @path: pointer to string containing export path to mount
36 * @version: mount version to use for this request
37 * @protocol: transport protocol to use for thie request
38 * @fh: pointer to location to place returned file handle
39 * 33 *
40 * Uses default timeout parameters specified by underlying transport. 34 * Uses default timeout parameters specified by underlying transport.
41 */ 35 */
42int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path, 36int nfs_mount(struct nfs_mount_request *info)
43 int version, int protocol, struct nfs_fh *fh)
44{ 37{
45 struct mnt_fhstatus result = { 38 struct mnt_fhstatus result = {
46 .fh = fh 39 .fh = info->fh
47 }; 40 };
48 struct rpc_message msg = { 41 struct rpc_message msg = {
49 .rpc_argp = path, 42 .rpc_argp = info->dirpath,
50 .rpc_resp = &result, 43 .rpc_resp = &result,
51 }; 44 };
52 struct rpc_create_args args = { 45 struct rpc_create_args args = {
53 .protocol = protocol, 46 .protocol = info->protocol,
54 .address = addr, 47 .address = info->sap,
55 .addrsize = len, 48 .addrsize = info->salen,
56 .servername = hostname, 49 .servername = info->hostname,
57 .program = &mnt_program, 50 .program = &mnt_program,
58 .version = version, 51 .version = info->version,
59 .authflavor = RPC_AUTH_UNIX, 52 .authflavor = RPC_AUTH_UNIX,
60 .flags = 0,
61 }; 53 };
62 struct rpc_clnt *mnt_clnt; 54 struct rpc_clnt *mnt_clnt;
63 int status; 55 int status;
64 56
65 dprintk("NFS: sending MNT request for %s:%s\n", 57 dprintk("NFS: sending MNT request for %s:%s\n",
66 (hostname ? hostname : "server"), path); 58 (info->hostname ? info->hostname : "server"),
59 info->dirpath);
60
61 if (info->noresvport)
62 args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
67 63
68 mnt_clnt = rpc_create(&args); 64 mnt_clnt = rpc_create(&args);
69 if (IS_ERR(mnt_clnt)) 65 if (IS_ERR(mnt_clnt))
70 goto out_clnt_err; 66 goto out_clnt_err;
71 67
72 if (version == NFS_MNT3_VERSION) 68 if (info->version == NFS_MNT3_VERSION)
73 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC3_MNT]; 69 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC3_MNT];
74 else 70 else
75 msg.rpc_proc = &mnt_clnt->cl_procinfo[MNTPROC_MNT]; 71 msg.rpc_proc = &mnt_clnt->cl_procinfo[MNTPROC_MNT];