Commit 24a9d9a2 authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

SUNRPC: Simplify queue timeouts using timer_reduce()

Simplify the setting of queue timeouts by using the timer_reduce()
function.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 5efd1876
...@@ -183,7 +183,6 @@ struct rpc_task_setup { ...@@ -183,7 +183,6 @@ struct rpc_task_setup {
struct rpc_timer { struct rpc_timer {
struct timer_list timer; struct timer_list timer;
struct list_head list; struct list_head list;
unsigned long expires;
}; };
/* /*
......
...@@ -92,8 +92,7 @@ __rpc_disable_timer(struct rpc_wait_queue *queue, struct rpc_task *task) ...@@ -92,8 +92,7 @@ __rpc_disable_timer(struct rpc_wait_queue *queue, struct rpc_task *task)
static void static void
rpc_set_queue_timer(struct rpc_wait_queue *queue, unsigned long expires) rpc_set_queue_timer(struct rpc_wait_queue *queue, unsigned long expires)
{ {
queue->timer_list.expires = expires; timer_reduce(&queue->timer_list.timer, expires);
mod_timer(&queue->timer_list.timer, expires);
} }
/* /*
...@@ -107,8 +106,7 @@ __rpc_add_timer(struct rpc_wait_queue *queue, struct rpc_task *task, ...@@ -107,8 +106,7 @@ __rpc_add_timer(struct rpc_wait_queue *queue, struct rpc_task *task,
task->tk_pid, jiffies_to_msecs(timeout - jiffies)); task->tk_pid, jiffies_to_msecs(timeout - jiffies));
task->tk_timeout = timeout; task->tk_timeout = timeout;
if (list_empty(&queue->timer_list.list) || time_before(timeout, queue->timer_list.expires)) rpc_set_queue_timer(queue, timeout);
rpc_set_queue_timer(queue, timeout);
list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list); list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment