diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-07-31 14:29:07 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-08-03 22:06:44 -0400 |
commit | f1f88fc7e818c6678c6799a2edb8f1aeccc124aa (patch) | |
tree | a5aec7e7e522500df78b5cbf1f2ce430462552e2 /net | |
parent | a6f03393ec86fd25523c79497a9a773bda170d1d (diff) |
SUNRPC: The function rpc_restart_call() should return success/failure
Both rpc_restart_call_prepare() and rpc_restart_call() test for the
RPC_TASK_KILLED flag, and fail to restart the RPC call if that flag is set.
This patch allows callers to know whether or not the restart was
successful, so that they can perform cleanups etc in case of failure.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/clnt.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 756fc324db9e..234c40c15f69 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -756,12 +756,13 @@ EXPORT_SYMBOL_GPL(rpc_force_rebind); | |||
756 | * Restart an (async) RPC call from the call_prepare state. | 756 | * Restart an (async) RPC call from the call_prepare state. |
757 | * Usually called from within the exit handler. | 757 | * Usually called from within the exit handler. |
758 | */ | 758 | */ |
759 | void | 759 | int |
760 | rpc_restart_call_prepare(struct rpc_task *task) | 760 | rpc_restart_call_prepare(struct rpc_task *task) |
761 | { | 761 | { |
762 | if (RPC_ASSASSINATED(task)) | 762 | if (RPC_ASSASSINATED(task)) |
763 | return; | 763 | return 0; |
764 | task->tk_action = rpc_prepare_task; | 764 | task->tk_action = rpc_prepare_task; |
765 | return 1; | ||
765 | } | 766 | } |
766 | EXPORT_SYMBOL_GPL(rpc_restart_call_prepare); | 767 | EXPORT_SYMBOL_GPL(rpc_restart_call_prepare); |
767 | 768 | ||
@@ -769,13 +770,13 @@ EXPORT_SYMBOL_GPL(rpc_restart_call_prepare); | |||
769 | * Restart an (async) RPC call. Usually called from within the | 770 | * Restart an (async) RPC call. Usually called from within the |
770 | * exit handler. | 771 | * exit handler. |
771 | */ | 772 | */ |
772 | void | 773 | int |
773 | rpc_restart_call(struct rpc_task *task) | 774 | rpc_restart_call(struct rpc_task *task) |
774 | { | 775 | { |
775 | if (RPC_ASSASSINATED(task)) | 776 | if (RPC_ASSASSINATED(task)) |
776 | return; | 777 | return 0; |
777 | |||
778 | task->tk_action = call_start; | 778 | task->tk_action = call_start; |
779 | return 1; | ||
779 | } | 780 | } |
780 | EXPORT_SYMBOL_GPL(rpc_restart_call); | 781 | EXPORT_SYMBOL_GPL(rpc_restart_call); |
781 | 782 | ||