aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r--net/sunrpc/sched.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index dff07795bd16..b9969b91a9f7 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -65,7 +65,7 @@ static LIST_HEAD(all_tasks);
65 */ 65 */
66static DEFINE_MUTEX(rpciod_mutex); 66static DEFINE_MUTEX(rpciod_mutex);
67static unsigned int rpciod_users; 67static unsigned int rpciod_users;
68static struct workqueue_struct *rpciod_workqueue; 68struct workqueue_struct *rpciod_workqueue;
69 69
70/* 70/*
71 * Spinlock for other critical sections of code. 71 * Spinlock for other critical sections of code.
@@ -182,6 +182,7 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue, struct rpc_task *
182 else 182 else
183 list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]); 183 list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]);
184 task->u.tk_wait.rpc_waitq = queue; 184 task->u.tk_wait.rpc_waitq = queue;
185 queue->qlen++;
185 rpc_set_queued(task); 186 rpc_set_queued(task);
186 187
187 dprintk("RPC: %4d added to queue %p \"%s\"\n", 188 dprintk("RPC: %4d added to queue %p \"%s\"\n",
@@ -216,6 +217,7 @@ static void __rpc_remove_wait_queue(struct rpc_task *task)
216 __rpc_remove_wait_queue_priority(task); 217 __rpc_remove_wait_queue_priority(task);
217 else 218 else
218 list_del(&task->u.tk_wait.list); 219 list_del(&task->u.tk_wait.list);
220 queue->qlen--;
219 dprintk("RPC: %4d removed from queue %p \"%s\"\n", 221 dprintk("RPC: %4d removed from queue %p \"%s\"\n",
220 task->tk_pid, queue, rpc_qname(queue)); 222 task->tk_pid, queue, rpc_qname(queue));
221} 223}
@@ -816,6 +818,9 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, int flags, cons
816 818
817 BUG_ON(task->tk_ops == NULL); 819 BUG_ON(task->tk_ops == NULL);
818 820
821 /* starting timestamp */
822 task->tk_start = jiffies;
823
819 dprintk("RPC: %4d new task procpid %d\n", task->tk_pid, 824 dprintk("RPC: %4d new task procpid %d\n", task->tk_pid,
820 current->pid); 825 current->pid);
821} 826}
@@ -917,8 +922,11 @@ struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
917{ 922{
918 struct rpc_task *task; 923 struct rpc_task *task;
919 task = rpc_new_task(clnt, flags, ops, data); 924 task = rpc_new_task(clnt, flags, ops, data);
920 if (task == NULL) 925 if (task == NULL) {
926 if (ops->rpc_release != NULL)
927 ops->rpc_release(data);
921 return ERR_PTR(-ENOMEM); 928 return ERR_PTR(-ENOMEM);
929 }
922 atomic_inc(&task->tk_count); 930 atomic_inc(&task->tk_count);
923 rpc_execute(task); 931 rpc_execute(task);
924 return task; 932 return task;