Merge branch 'bkl-removal' into next
[pandora-kernel.git] / net / sunrpc / sched.c
index cae219c..385f427 100644 (file)
@@ -576,9 +576,7 @@ EXPORT_SYMBOL_GPL(rpc_delay);
  */
 static void rpc_prepare_task(struct rpc_task *task)
 {
-       lock_kernel();
        task->tk_ops->rpc_call_prepare(task, task->tk_calldata);
-       unlock_kernel();
 }
 
 /*
@@ -588,9 +586,7 @@ void rpc_exit_task(struct rpc_task *task)
 {
        task->tk_action = NULL;
        if (task->tk_ops->rpc_call_done != NULL) {
-               lock_kernel();
                task->tk_ops->rpc_call_done(task, task->tk_calldata);
-               unlock_kernel();
                if (task->tk_action != NULL) {
                        WARN_ON(RPC_ASSASSINATED(task));
                        /* Always release the RPC slot and buffer memory */
@@ -602,11 +598,8 @@ EXPORT_SYMBOL_GPL(rpc_exit_task);
 
 void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata)
 {
-       if (ops->rpc_release != NULL) {
-               lock_kernel();
+       if (ops->rpc_release != NULL)
                ops->rpc_release(calldata);
-               unlock_kernel();
-       }
 }
 
 /*
@@ -626,19 +619,15 @@ static void __rpc_execute(struct rpc_task *task)
                /*
                 * Execute any pending callback.
                 */
-               if (RPC_DO_CALLBACK(task)) {
-                       /* Define a callback save pointer */
+               if (task->tk_callback) {
                        void (*save_callback)(struct rpc_task *);
 
                        /*
-                        * If a callback exists, save it, reset it,
-                        * call it.
-                        * The save is needed to stop from resetting
-                        * another callback set within the callback handler
-                        * - Dave
+                        * We set tk_callback to NULL before calling it,
+                        * in case it sets the tk_callback field itself:
                         */
-                       save_callback=task->tk_callback;
-                       task->tk_callback=NULL;
+                       save_callback = task->tk_callback;
+                       task->tk_callback = NULL;
                        save_callback(task);
                }
 
@@ -817,12 +806,11 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta
                task->tk_action = rpc_prepare_task;
 
        if (task_setup_data->rpc_message != NULL) {
-               memcpy(&task->tk_msg, task_setup_data->rpc_message, sizeof(task->tk_msg));
+               task->tk_msg.rpc_proc = task_setup_data->rpc_message->rpc_proc;
+               task->tk_msg.rpc_argp = task_setup_data->rpc_message->rpc_argp;
+               task->tk_msg.rpc_resp = task_setup_data->rpc_message->rpc_resp;
                /* Bind the user cred */
-               if (task->tk_msg.rpc_cred != NULL)
-                       rpcauth_holdcred(task);
-               else
-                       rpcauth_bindcred(task);
+               rpcauth_bindcred(task, task_setup_data->rpc_message->rpc_cred, task_setup_data->flags);
                if (task->tk_action == NULL)
                        rpc_call_start(task);
        }