aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-14 15:40:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:32 -0500
commit5138fde01161cd7976fdc51f6a17da73adaa6baf (patch)
tree57dea902155fc4c31667ffbc412782edf2593b01 /net
parentbdc7f021f3a1fade77adf3c2d7f65690566fddfe (diff)
NFS/SUNRPC: Convert all users of rpc_call_setup()
Replace use of rpc_call_setup() with rpc_init_task(), and in cases where we need to initialise task->tk_action, with rpc_call_start(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/rpcb_clnt.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index 7c362e5f6e1b..f876e37d1972 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -128,19 +128,6 @@ struct rpcb_info {
128static struct rpcb_info rpcb_next_version[]; 128static struct rpcb_info rpcb_next_version[];
129static struct rpcb_info rpcb_next_version6[]; 129static struct rpcb_info rpcb_next_version6[];
130 130
131static void rpcb_getport_prepare(struct rpc_task *task, void *calldata)
132{
133 struct rpcbind_args *map = calldata;
134 struct rpc_xprt *xprt = map->r_xprt;
135 struct rpc_message msg = {
136 .rpc_proc = rpcb_next_version[xprt->bind_index].rpc_proc,
137 .rpc_argp = map,
138 .rpc_resp = &map->r_port,
139 };
140
141 rpc_call_setup(task, &msg, 0);
142}
143
144static void rpcb_map_release(void *data) 131static void rpcb_map_release(void *data)
145{ 132{
146 struct rpcbind_args *map = data; 133 struct rpcbind_args *map = data;
@@ -150,7 +137,6 @@ static void rpcb_map_release(void *data)
150} 137}
151 138
152static const struct rpc_call_ops rpcb_getport_ops = { 139static const struct rpc_call_ops rpcb_getport_ops = {
153 .rpc_call_prepare = rpcb_getport_prepare,
154 .rpc_call_done = rpcb_getport_done, 140 .rpc_call_done = rpcb_getport_done,
155 .rpc_release = rpcb_map_release, 141 .rpc_release = rpcb_map_release,
156}; 142};
@@ -295,6 +281,24 @@ int rpcb_getport_sync(struct sockaddr_in *sin, __u32 prog,
295} 281}
296EXPORT_SYMBOL_GPL(rpcb_getport_sync); 282EXPORT_SYMBOL_GPL(rpcb_getport_sync);
297 283
284static struct rpc_task *rpcb_call_async(struct rpc_clnt *rpcb_clnt, struct rpcbind_args *map, int version)
285{
286 struct rpc_message msg = {
287 .rpc_proc = rpcb_next_version[version].rpc_proc,
288 .rpc_argp = map,
289 .rpc_resp = &map->r_port,
290 };
291 struct rpc_task_setup task_setup_data = {
292 .rpc_client = rpcb_clnt,
293 .rpc_message = &msg,
294 .callback_ops = &rpcb_getport_ops,
295 .callback_data = map,
296 .flags = RPC_TASK_ASYNC,
297 };
298
299 return rpc_run_task(&task_setup_data);
300}
301
298/** 302/**
299 * rpcb_getport_async - obtain the port for a given RPC service on a given host 303 * rpcb_getport_async - obtain the port for a given RPC service on a given host
300 * @task: task that is waiting for portmapper request 304 * @task: task that is waiting for portmapper request
@@ -310,10 +314,6 @@ void rpcb_getport_async(struct rpc_task *task)
310 struct rpc_clnt *rpcb_clnt; 314 struct rpc_clnt *rpcb_clnt;
311 static struct rpcbind_args *map; 315 static struct rpcbind_args *map;
312 struct rpc_task *child; 316 struct rpc_task *child;
313 struct rpc_task_setup task_setup_data = {
314 .callback_ops = &rpcb_getport_ops,
315 .flags = RPC_TASK_ASYNC,
316 };
317 struct sockaddr addr; 317 struct sockaddr addr;
318 int status; 318 int status;
319 struct rpcb_info *info; 319 struct rpcb_info *info;
@@ -399,9 +399,7 @@ void rpcb_getport_async(struct rpc_task *task)
399 sizeof(map->r_addr)); 399 sizeof(map->r_addr));
400 map->r_owner = RPCB_OWNER_STRING; /* ignored for GETADDR */ 400 map->r_owner = RPCB_OWNER_STRING; /* ignored for GETADDR */
401 401
402 task_setup_data.rpc_client = rpcb_clnt; 402 child = rpcb_call_async(rpcb_clnt, map, xprt->bind_index);
403 task_setup_data.callback_data = map;
404 child = rpc_run_task(&task_setup_data);
405 rpc_release_client(rpcb_clnt); 403 rpc_release_client(rpcb_clnt);
406 if (IS_ERR(child)) { 404 if (IS_ERR(child)) {
407 status = -EIO; 405 status = -EIO;