]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
RPC: Clean up rpc_execute...
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 3 Feb 2007 21:38:41 +0000 (13:38 -0800)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 3 Feb 2007 23:35:03 +0000 (15:35 -0800)
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>
include/linux/sunrpc/sched.h
net/sunrpc/clnt.c
net/sunrpc/sched.c

index 8b6ce60ea0578f0284e74029f507b8f224831e85..de9fc576fa1c8000b56683650a6b250b15a7e5b6 100644 (file)
@@ -253,7 +253,7 @@ void                rpc_put_task(struct rpc_task *);
 void           rpc_exit_task(struct rpc_task *);
 void           rpc_release_calldata(const struct rpc_call_ops *, void *);
 void           rpc_killall_tasks(struct rpc_clnt *);
-int            rpc_execute(struct rpc_task *);
+void           rpc_execute(struct rpc_task *);
 void           rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
 void           rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
 void           rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
index 16c9fbc1db6995e059ec263aa02449f912bd3942..e9d5f3c562e5feae642f323f5a53780505efd272 100644 (file)
@@ -486,17 +486,13 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
        /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */
        rpc_task_sigmask(task, &oldset);
 
-       rpc_call_setup(task, msg, 0);
-
        /* Set up the call info struct and execute the task */
+       rpc_call_setup(task, msg, 0);
+       if (task->tk_status == 0) {
+               atomic_inc(&task->tk_count);
+               rpc_execute(task);
+       }
        status = task->tk_status;
-       if (status != 0)
-               goto out;
-       atomic_inc(&task->tk_count);
-       status = rpc_execute(task);
-       if (status == 0)
-               status = task->tk_status;
-out:
        rpc_put_task(task);
        rpc_restore_sigmask(&oldset);
        return status;
index fc083f0b354434940b98aa27e882f9d4bef8bfe6..13ab0c6fed01981a831386728e45f0fce30b1fc4 100644 (file)
@@ -625,7 +625,7 @@ void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata)
 /*
  * This is the RPC `scheduler' (or rather, the finite state machine).
  */
-static int __rpc_execute(struct rpc_task *task)
+static void __rpc_execute(struct rpc_task *task)
 {
        int             status = 0;
 
@@ -679,9 +679,9 @@ static int __rpc_execute(struct rpc_task *task)
                if (RPC_IS_ASYNC(task)) {
                        /* Careful! we may have raced... */
                        if (RPC_IS_QUEUED(task))
-                               return 0;
+                               return;
                        if (rpc_test_and_set_running(task))
-                               return 0;
+                               return;
                        continue;
                }
 
@@ -710,7 +710,6 @@ static int __rpc_execute(struct rpc_task *task)
        dprintk("RPC: %4d, return %d, status %d\n", task->tk_pid, status, task->tk_status);
        /* Release all resources associated with the task */
        rpc_release_task(task);
-       return status;
 }
 
 /*
@@ -722,12 +721,11 @@ static int __rpc_execute(struct rpc_task *task)
  *      released. In particular note that tk_release() will have
  *      been called, so your task memory may have been freed.
  */
-int
-rpc_execute(struct rpc_task *task)
+void rpc_execute(struct rpc_task *task)
 {
        rpc_set_active(task);
        rpc_set_running(task);
-       return __rpc_execute(task);
+       __rpc_execute(task);
 }
 
 static void rpc_async_schedule(struct work_struct *work)