diff options
author | Trond Myklebust <trondmy@gmail.com> | 2019-04-07 13:58:51 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2019-04-25 14:18:13 -0400 |
commit | 24a9d9a21e568f494198eea2bb864e0b6c593051 (patch) | |
tree | 24a63db84678bbacf0f3d0f68071c2b73bcdafa5 /net/sunrpc | |
parent | 5efd1876e61fe61b61e2d056782027c11bcd0982 (diff) | |
download | linux-stable-24a9d9a21e568f494198eea2bb864e0b6c593051.tar.gz linux-stable-24a9d9a21e568f494198eea2bb864e0b6c593051.tar.bz2 linux-stable-24a9d9a21e568f494198eea2bb864e0b6c593051.zip |
SUNRPC: Simplify queue timeouts using timer_reduce()
Simplify the setting of queue timeouts by using the timer_reduce()
function.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/sched.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 40944c34a9e4..301e0f7f1dc9 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -92,8 +92,7 @@ __rpc_disable_timer(struct rpc_wait_queue *queue, struct rpc_task *task) static void rpc_set_queue_timer(struct rpc_wait_queue *queue, unsigned long expires) { - queue->timer_list.expires = expires; - mod_timer(&queue->timer_list.timer, expires); + timer_reduce(&queue->timer_list.timer, expires); } /* @@ -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_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); } |