Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e8f5d77c8029ff8f5dcd1dfc133aac0bbbffd92b
Commit:     e8f5d77c8029ff8f5dcd1dfc133aac0bbbffd92b
Parent:     b5627943ab6fabbc13a45d92683363a3d08a249f
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 25 18:42:53 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 02:05:38 2008 -0500

    SUNRPC: allow the caller of rpc_run_task to preallocate the struct rpc_task
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 include/linux/sunrpc/sched.h |    1 +
 net/sunrpc/sched.c           |   16 ++++++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index c9444fd..60a05c7 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -118,6 +118,7 @@ struct rpc_call_ops {
 };
 
 struct rpc_task_setup {
+       struct rpc_task *task;
        struct rpc_clnt *rpc_client;
        const struct rpc_message *rpc_message;
        const struct rpc_call_ops *callback_ops;
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index fa53a88..c03e7bf 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -885,16 +885,20 @@ static void rpc_free_task(struct rcu_head *rcu)
  */
 struct rpc_task *rpc_new_task(const struct rpc_task_setup *setup_data)
 {
-       struct rpc_task *task;
-
-       task = rpc_alloc_task();
-       if (!task)
-               goto out;
+       struct rpc_task *task = setup_data->task;
+       unsigned short flags = 0;
+
+       if (task == NULL) {
+               task = rpc_alloc_task();
+               if (task == NULL)
+                       goto out;
+               flags = RPC_TASK_DYNAMIC;
+       }
 
        rpc_init_task(task, setup_data);
 
+       task->tk_flags |= flags;
        dprintk("RPC:       allocated task %p\n", task);
-       task->tk_flags |= RPC_TASK_DYNAMIC;
 out:
        return task;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to