diff options
author | Chuck Lever <cel@netapp.com> | 2006-03-20 13:44:23 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:23 -0500 |
commit | dead28da8e3fb32601d38fb32b7021122e0a3d21 (patch) | |
tree | a1a23e27e08345c86ed0d9812f848470b615eb34 /fs/nfs/mount_clnt.c | |
parent | cc0175c1dc1de8f6af0eb0631dcc5b999a6fcc42 (diff) |
SUNRPC: eliminate rpc_call()
Clean-up: replace rpc_call() helper with direct call to rpc_call_sync.
This makes NFSv2 and NFSv3 synchronous calls more computationally
efficient, and reduces stack consumption in functions that used to
invoke rpc_call more than once.
Test plan:
Compile kernel with CONFIG_NFS enabled. Connectathon on NFS version 2,
version 3, and version 4 mount points.
Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/mount_clnt.c')
-rw-r--r-- | fs/nfs/mount_clnt.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index 4a1340358223..c44d87bdddb3 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c | |||
@@ -49,9 +49,12 @@ nfsroot_mount(struct sockaddr_in *addr, char *path, struct nfs_fh *fh, | |||
49 | struct mnt_fhstatus result = { | 49 | struct mnt_fhstatus result = { |
50 | .fh = fh | 50 | .fh = fh |
51 | }; | 51 | }; |
52 | struct rpc_message msg = { | ||
53 | .rpc_argp = path, | ||
54 | .rpc_resp = &result, | ||
55 | }; | ||
52 | char hostname[32]; | 56 | char hostname[32]; |
53 | int status; | 57 | int status; |
54 | int call; | ||
55 | 58 | ||
56 | dprintk("NFS: nfs_mount(%08x:%s)\n", | 59 | dprintk("NFS: nfs_mount(%08x:%s)\n", |
57 | (unsigned)ntohl(addr->sin_addr.s_addr), path); | 60 | (unsigned)ntohl(addr->sin_addr.s_addr), path); |
@@ -61,8 +64,12 @@ nfsroot_mount(struct sockaddr_in *addr, char *path, struct nfs_fh *fh, | |||
61 | if (IS_ERR(mnt_clnt)) | 64 | if (IS_ERR(mnt_clnt)) |
62 | return PTR_ERR(mnt_clnt); | 65 | return PTR_ERR(mnt_clnt); |
63 | 66 | ||
64 | call = (version == NFS_MNT3_VERSION) ? MOUNTPROC3_MNT : MNTPROC_MNT; | 67 | if (version == NFS_MNT3_VERSION) |
65 | status = rpc_call(mnt_clnt, call, path, &result, 0); | 68 | msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC3_MNT]; |
69 | else | ||
70 | msg.rpc_proc = &mnt_clnt->cl_procinfo[MNTPROC_MNT]; | ||
71 | |||
72 | status = rpc_call_sync(mnt_clnt, &msg, 0); | ||
66 | return status < 0? status : (result.status? -EACCES : 0); | 73 | return status < 0? status : (result.status? -EACCES : 0); |
67 | } | 74 | } |
68 | 75 | ||