aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc_xprt.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-16 20:29:42 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-18 07:40:27 -0400
commitff861c4d64f2df1c7eaabaf2ba8f2f8ebc4b28e3 (patch)
tree149c0e1ec9e7711d559c76ea0e5d82893d92b168 /net/sunrpc/svc_xprt.c
parent1ab791dc27faef5aee80fe76d73980d2de0bebc8 (diff)
sunrpc: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Trond Myklebust <trond.myklebust@primarydata.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r--net/sunrpc/svc_xprt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index d16a8b423c20..71de77bd4423 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -28,7 +28,7 @@ module_param(svc_rpc_per_connection_limit, uint, 0644);
28static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt); 28static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt);
29static int svc_deferred_recv(struct svc_rqst *rqstp); 29static int svc_deferred_recv(struct svc_rqst *rqstp);
30static struct cache_deferred_req *svc_defer(struct cache_req *req); 30static struct cache_deferred_req *svc_defer(struct cache_req *req);
31static void svc_age_temp_xprts(unsigned long closure); 31static void svc_age_temp_xprts(struct timer_list *t);
32static void svc_delete_xprt(struct svc_xprt *xprt); 32static void svc_delete_xprt(struct svc_xprt *xprt);
33 33
34/* apparently the "standard" is that clients close 34/* apparently the "standard" is that clients close
@@ -785,8 +785,7 @@ static void svc_add_new_temp_xprt(struct svc_serv *serv, struct svc_xprt *newxpt
785 serv->sv_tmpcnt++; 785 serv->sv_tmpcnt++;
786 if (serv->sv_temptimer.function == NULL) { 786 if (serv->sv_temptimer.function == NULL) {
787 /* setup timer to age temp transports */ 787 /* setup timer to age temp transports */
788 setup_timer(&serv->sv_temptimer, svc_age_temp_xprts, 788 serv->sv_temptimer.function = (TIMER_FUNC_TYPE)svc_age_temp_xprts;
789 (unsigned long)serv);
790 mod_timer(&serv->sv_temptimer, 789 mod_timer(&serv->sv_temptimer,
791 jiffies + svc_conn_age_period * HZ); 790 jiffies + svc_conn_age_period * HZ);
792 } 791 }
@@ -960,9 +959,9 @@ out:
960 * Timer function to close old temporary transports, using 959 * Timer function to close old temporary transports, using
961 * a mark-and-sweep algorithm. 960 * a mark-and-sweep algorithm.
962 */ 961 */
963static void svc_age_temp_xprts(unsigned long closure) 962static void svc_age_temp_xprts(struct timer_list *t)
964{ 963{
965 struct svc_serv *serv = (struct svc_serv *)closure; 964 struct svc_serv *serv = from_timer(serv, t, sv_temptimer);
966 struct svc_xprt *xprt; 965 struct svc_xprt *xprt;
967 struct list_head *le, *next; 966 struct list_head *le, *next;
968 967