diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-02-03 16:38:41 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-02-03 18:35:03 -0500 |
commit | 2efef837fb84f78cee7439804cb3722bffc64e75 (patch) | |
tree | b69166832927f2141c4173cac456747605ea6252 | |
parent | 54cc533aaa0dc331ad126f0aacfb19572adee638 (diff) |
RPC: Clean up rpc_execute...
The error values are already propagated through task->tk_status, and
none of the callers check one without checking the other, so we can
drop the return value.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | include/linux/sunrpc/sched.h | 2 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 14 | ||||
-rw-r--r-- | net/sunrpc/sched.c | 12 |
3 files changed, 11 insertions, 17 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 8b6ce60ea057..de9fc576fa1c 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -253,7 +253,7 @@ void rpc_put_task(struct rpc_task *); | |||
253 | void rpc_exit_task(struct rpc_task *); | 253 | void rpc_exit_task(struct rpc_task *); |
254 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 254 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
255 | void rpc_killall_tasks(struct rpc_clnt *); | 255 | void rpc_killall_tasks(struct rpc_clnt *); |
256 | int rpc_execute(struct rpc_task *); | 256 | void rpc_execute(struct rpc_task *); |
257 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); | 257 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); |
258 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); | 258 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); |
259 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, | 259 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 16c9fbc1db69..e9d5f3c562e5 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -486,17 +486,13 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
486 | /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */ | 486 | /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */ |
487 | rpc_task_sigmask(task, &oldset); | 487 | rpc_task_sigmask(task, &oldset); |
488 | 488 | ||
489 | rpc_call_setup(task, msg, 0); | ||
490 | |||
491 | /* Set up the call info struct and execute the task */ | 489 | /* Set up the call info struct and execute the task */ |
490 | rpc_call_setup(task, msg, 0); | ||
491 | if (task->tk_status == 0) { | ||
492 | atomic_inc(&task->tk_count); | ||
493 | rpc_execute(task); | ||
494 | } | ||
492 | status = task->tk_status; | 495 | status = task->tk_status; |
493 | if (status != 0) | ||
494 | goto out; | ||
495 | atomic_inc(&task->tk_count); | ||
496 | status = rpc_execute(task); | ||
497 | if (status == 0) | ||
498 | status = task->tk_status; | ||
499 | out: | ||
500 | rpc_put_task(task); | 496 | rpc_put_task(task); |
501 | rpc_restore_sigmask(&oldset); | 497 | rpc_restore_sigmask(&oldset); |
502 | return status; | 498 | return status; |
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index fc083f0b3544..13ab0c6fed01 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -625,7 +625,7 @@ void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata) | |||
625 | /* | 625 | /* |
626 | * This is the RPC `scheduler' (or rather, the finite state machine). | 626 | * This is the RPC `scheduler' (or rather, the finite state machine). |
627 | */ | 627 | */ |
628 | static int __rpc_execute(struct rpc_task *task) | 628 | static void __rpc_execute(struct rpc_task *task) |
629 | { | 629 | { |
630 | int status = 0; | 630 | int status = 0; |
631 | 631 | ||
@@ -679,9 +679,9 @@ static int __rpc_execute(struct rpc_task *task) | |||
679 | if (RPC_IS_ASYNC(task)) { | 679 | if (RPC_IS_ASYNC(task)) { |
680 | /* Careful! we may have raced... */ | 680 | /* Careful! we may have raced... */ |
681 | if (RPC_IS_QUEUED(task)) | 681 | if (RPC_IS_QUEUED(task)) |
682 | return 0; | 682 | return; |
683 | if (rpc_test_and_set_running(task)) | 683 | if (rpc_test_and_set_running(task)) |
684 | return 0; | 684 | return; |
685 | continue; | 685 | continue; |
686 | } | 686 | } |
687 | 687 | ||
@@ -710,7 +710,6 @@ static int __rpc_execute(struct rpc_task *task) | |||
710 | dprintk("RPC: %4d, return %d, status %d\n", task->tk_pid, status, task->tk_status); | 710 | dprintk("RPC: %4d, return %d, status %d\n", task->tk_pid, status, task->tk_status); |
711 | /* Release all resources associated with the task */ | 711 | /* Release all resources associated with the task */ |
712 | rpc_release_task(task); | 712 | rpc_release_task(task); |
713 | return status; | ||
714 | } | 713 | } |
715 | 714 | ||
716 | /* | 715 | /* |
@@ -722,12 +721,11 @@ static int __rpc_execute(struct rpc_task *task) | |||
722 | * released. In particular note that tk_release() will have | 721 | * released. In particular note that tk_release() will have |
723 | * been called, so your task memory may have been freed. | 722 | * been called, so your task memory may have been freed. |
724 | */ | 723 | */ |
725 | int | 724 | void rpc_execute(struct rpc_task *task) |
726 | rpc_execute(struct rpc_task *task) | ||
727 | { | 725 | { |
728 | rpc_set_active(task); | 726 | rpc_set_active(task); |
729 | rpc_set_running(task); | 727 | rpc_set_running(task); |
730 | return __rpc_execute(task); | 728 | __rpc_execute(task); |
731 | } | 729 | } |
732 | 730 | ||
733 | static void rpc_async_schedule(struct work_struct *work) | 731 | static void rpc_async_schedule(struct work_struct *work) |