From c970aa85e71bd581726c42df843f6f129db275ac Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 14 Jul 2007 15:39:59 -0400 Subject: SUNRPC: Clean up rpc_run_task Make it use the new task initialiser structure instead of acting as a wrapper. Signed-off-by: Trond Myklebust --- net/sunrpc/clnt.c | 36 +++++++++--------------------------- net/sunrpc/rpcb_clnt.c | 8 +++++++- 2 files changed, 16 insertions(+), 28 deletions(-) (limited to 'net') diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 7c80abd9263f..9aad45946d32 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -523,8 +523,11 @@ void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset) } EXPORT_SYMBOL_GPL(rpc_clnt_sigunmask); -static -struct rpc_task *rpc_do_run_task(const struct rpc_task_setup *task_setup_data) +/** + * rpc_run_task - Allocate a new RPC task, then run rpc_execute against it + * @task_setup_data: pointer to task initialisation data + */ +struct rpc_task *rpc_run_task(const struct rpc_task_setup *task_setup_data) { struct rpc_task *task, *ret; sigset_t oldset; @@ -553,6 +556,7 @@ out: rpc_restore_sigmask(&oldset); return ret; } +EXPORT_SYMBOL_GPL(rpc_run_task); /** * rpc_call_sync - Perform a synchronous RPC call @@ -573,7 +577,7 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) BUG_ON(flags & RPC_TASK_ASYNC); - task = rpc_do_run_task(&task_setup_data); + task = rpc_run_task(&task_setup_data); if (IS_ERR(task)) return PTR_ERR(task); status = task->tk_status; @@ -603,7 +607,7 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags, .flags = flags|RPC_TASK_ASYNC, }; - task = rpc_do_run_task(&task_setup_data); + task = rpc_run_task(&task_setup_data); if (IS_ERR(task)) return PTR_ERR(task); rpc_put_task(task); @@ -611,28 +615,6 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags, } EXPORT_SYMBOL_GPL(rpc_call_async); -/** - * rpc_run_task - Allocate a new RPC task, then run rpc_execute against it - * @clnt: pointer to RPC client - * @flags: RPC flags - * @ops: RPC call ops - * @data: user call data - */ -struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, - const struct rpc_call_ops *tk_ops, - void *data) -{ - struct rpc_task_setup task_setup_data = { - .rpc_client = clnt, - .callback_ops = tk_ops, - .callback_data = data, - .flags = flags, - }; - - return rpc_do_run_task(&task_setup_data); -} -EXPORT_SYMBOL_GPL(rpc_run_task); - void rpc_call_setup(struct rpc_task *task, const struct rpc_message *msg, int flags) { @@ -1550,7 +1532,7 @@ struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, int .callback_ops = &rpc_default_ops, .flags = flags, }; - return rpc_do_run_task(&task_setup_data); + return rpc_run_task(&task_setup_data); } EXPORT_SYMBOL_GPL(rpc_call_null); diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index a05493aedb68..7c362e5f6e1b 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -310,6 +310,10 @@ void rpcb_getport_async(struct rpc_task *task) struct rpc_clnt *rpcb_clnt; static struct rpcbind_args *map; struct rpc_task *child; + struct rpc_task_setup task_setup_data = { + .callback_ops = &rpcb_getport_ops, + .flags = RPC_TASK_ASYNC, + }; struct sockaddr addr; int status; struct rpcb_info *info; @@ -395,7 +399,9 @@ void rpcb_getport_async(struct rpc_task *task) sizeof(map->r_addr)); map->r_owner = RPCB_OWNER_STRING; /* ignored for GETADDR */ - child = rpc_run_task(rpcb_clnt, RPC_TASK_ASYNC, &rpcb_getport_ops, map); + task_setup_data.rpc_client = rpcb_clnt; + task_setup_data.callback_data = map; + child = rpc_run_task(&task_setup_data); rpc_release_client(rpcb_clnt); if (IS_ERR(child)) { status = -EIO; -- cgit v1.2.3