diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-11-09 05:42:52 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-11-09 05:42:52 -0500 |
commit | b3fe565bf47de3f79bb5dff9bee1112b46ba5434 (patch) | |
tree | 45aa561055dd779b75b4181d8855b4481dd483be /net | |
parent | 1c10bbee8cf7c8df4e5d9e8ccc9754b200f625ff (diff) | |
parent | 3653bc95bcc7daa938c0fdcd64ff199ed8f7f208 (diff) |
Merge tag 'timers-conversion-next5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into timers/core
Pull the 5th batch of timer conversions from Kees Cook
- qla2xxx patches have passed testing
- ipvs patches have been Acked
- prepare for more tree-wide DEFINE_TIMER() changes
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_conn.c | 10 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 7 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_est.c | 6 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_lblc.c | 11 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_lblcr.c | 11 |
5 files changed, 23 insertions, 22 deletions
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c index 3d2ac71a83ec..3a43b3470331 100644 --- a/net/netfilter/ipvs/ip_vs_conn.c +++ b/net/netfilter/ipvs/ip_vs_conn.c | |||
@@ -104,7 +104,7 @@ static inline void ct_write_unlock_bh(unsigned int key) | |||
104 | spin_unlock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l); | 104 | spin_unlock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l); |
105 | } | 105 | } |
106 | 106 | ||
107 | static void ip_vs_conn_expire(unsigned long data); | 107 | static void ip_vs_conn_expire(struct timer_list *t); |
108 | 108 | ||
109 | /* | 109 | /* |
110 | * Returns hash value for IPVS connection entry | 110 | * Returns hash value for IPVS connection entry |
@@ -457,7 +457,7 @@ EXPORT_SYMBOL_GPL(ip_vs_conn_out_get_proto); | |||
457 | static void __ip_vs_conn_put_notimer(struct ip_vs_conn *cp) | 457 | static void __ip_vs_conn_put_notimer(struct ip_vs_conn *cp) |
458 | { | 458 | { |
459 | __ip_vs_conn_put(cp); | 459 | __ip_vs_conn_put(cp); |
460 | ip_vs_conn_expire((unsigned long)cp); | 460 | ip_vs_conn_expire(&cp->timer); |
461 | } | 461 | } |
462 | 462 | ||
463 | /* | 463 | /* |
@@ -817,9 +817,9 @@ static void ip_vs_conn_rcu_free(struct rcu_head *head) | |||
817 | kmem_cache_free(ip_vs_conn_cachep, cp); | 817 | kmem_cache_free(ip_vs_conn_cachep, cp); |
818 | } | 818 | } |
819 | 819 | ||
820 | static void ip_vs_conn_expire(unsigned long data) | 820 | static void ip_vs_conn_expire(struct timer_list *t) |
821 | { | 821 | { |
822 | struct ip_vs_conn *cp = (struct ip_vs_conn *)data; | 822 | struct ip_vs_conn *cp = from_timer(cp, t, timer); |
823 | struct netns_ipvs *ipvs = cp->ipvs; | 823 | struct netns_ipvs *ipvs = cp->ipvs; |
824 | 824 | ||
825 | /* | 825 | /* |
@@ -909,7 +909,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p, int dest_af, | |||
909 | } | 909 | } |
910 | 910 | ||
911 | INIT_HLIST_NODE(&cp->c_list); | 911 | INIT_HLIST_NODE(&cp->c_list); |
912 | setup_timer(&cp->timer, ip_vs_conn_expire, (unsigned long)cp); | 912 | timer_setup(&cp->timer, ip_vs_conn_expire, 0); |
913 | cp->ipvs = ipvs; | 913 | cp->ipvs = ipvs; |
914 | cp->af = p->af; | 914 | cp->af = p->af; |
915 | cp->daf = dest_af; | 915 | cp->daf = dest_af; |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 4f940d7eb2f7..b47e266c6eca 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -1146,9 +1146,9 @@ ip_vs_del_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest) | |||
1146 | return 0; | 1146 | return 0; |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | static void ip_vs_dest_trash_expire(unsigned long data) | 1149 | static void ip_vs_dest_trash_expire(struct timer_list *t) |
1150 | { | 1150 | { |
1151 | struct netns_ipvs *ipvs = (struct netns_ipvs *)data; | 1151 | struct netns_ipvs *ipvs = from_timer(ipvs, t, dest_trash_timer); |
1152 | struct ip_vs_dest *dest, *next; | 1152 | struct ip_vs_dest *dest, *next; |
1153 | unsigned long now = jiffies; | 1153 | unsigned long now = jiffies; |
1154 | 1154 | ||
@@ -4019,8 +4019,7 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs) | |||
4019 | 4019 | ||
4020 | INIT_LIST_HEAD(&ipvs->dest_trash); | 4020 | INIT_LIST_HEAD(&ipvs->dest_trash); |
4021 | spin_lock_init(&ipvs->dest_trash_lock); | 4021 | spin_lock_init(&ipvs->dest_trash_lock); |
4022 | setup_timer(&ipvs->dest_trash_timer, ip_vs_dest_trash_expire, | 4022 | timer_setup(&ipvs->dest_trash_timer, ip_vs_dest_trash_expire, 0); |
4023 | (unsigned long) ipvs); | ||
4024 | atomic_set(&ipvs->ftpsvc_counter, 0); | 4023 | atomic_set(&ipvs->ftpsvc_counter, 0); |
4025 | atomic_set(&ipvs->nullsvc_counter, 0); | 4024 | atomic_set(&ipvs->nullsvc_counter, 0); |
4026 | atomic_set(&ipvs->conn_out_counter, 0); | 4025 | atomic_set(&ipvs->conn_out_counter, 0); |
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c index 457c6c193e13..489055091a9b 100644 --- a/net/netfilter/ipvs/ip_vs_est.c +++ b/net/netfilter/ipvs/ip_vs_est.c | |||
@@ -97,12 +97,12 @@ static void ip_vs_read_cpu_stats(struct ip_vs_kstats *sum, | |||
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | static void estimation_timer(unsigned long arg) | 100 | static void estimation_timer(struct timer_list *t) |
101 | { | 101 | { |
102 | struct ip_vs_estimator *e; | 102 | struct ip_vs_estimator *e; |
103 | struct ip_vs_stats *s; | 103 | struct ip_vs_stats *s; |
104 | u64 rate; | 104 | u64 rate; |
105 | struct netns_ipvs *ipvs = (struct netns_ipvs *)arg; | 105 | struct netns_ipvs *ipvs = from_timer(ipvs, t, est_timer); |
106 | 106 | ||
107 | spin_lock(&ipvs->est_lock); | 107 | spin_lock(&ipvs->est_lock); |
108 | list_for_each_entry(e, &ipvs->est_list, list) { | 108 | list_for_each_entry(e, &ipvs->est_list, list) { |
@@ -192,7 +192,7 @@ int __net_init ip_vs_estimator_net_init(struct netns_ipvs *ipvs) | |||
192 | { | 192 | { |
193 | INIT_LIST_HEAD(&ipvs->est_list); | 193 | INIT_LIST_HEAD(&ipvs->est_list); |
194 | spin_lock_init(&ipvs->est_lock); | 194 | spin_lock_init(&ipvs->est_lock); |
195 | setup_timer(&ipvs->est_timer, estimation_timer, (unsigned long)ipvs); | 195 | timer_setup(&ipvs->est_timer, estimation_timer, 0); |
196 | mod_timer(&ipvs->est_timer, jiffies + 2 * HZ); | 196 | mod_timer(&ipvs->est_timer, jiffies + 2 * HZ); |
197 | return 0; | 197 | return 0; |
198 | } | 198 | } |
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index b6aa4a970c6e..d625179de485 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c | |||
@@ -106,6 +106,7 @@ struct ip_vs_lblc_table { | |||
106 | struct rcu_head rcu_head; | 106 | struct rcu_head rcu_head; |
107 | struct hlist_head bucket[IP_VS_LBLC_TAB_SIZE]; /* hash bucket */ | 107 | struct hlist_head bucket[IP_VS_LBLC_TAB_SIZE]; /* hash bucket */ |
108 | struct timer_list periodic_timer; /* collect stale entries */ | 108 | struct timer_list periodic_timer; /* collect stale entries */ |
109 | struct ip_vs_service *svc; /* pointer back to service */ | ||
109 | atomic_t entries; /* number of entries */ | 110 | atomic_t entries; /* number of entries */ |
110 | int max_size; /* maximum size of entries */ | 111 | int max_size; /* maximum size of entries */ |
111 | int rover; /* rover for expire check */ | 112 | int rover; /* rover for expire check */ |
@@ -294,10 +295,10 @@ static inline void ip_vs_lblc_full_check(struct ip_vs_service *svc) | |||
294 | * of the table. | 295 | * of the table. |
295 | * The full expiration check is for this purpose now. | 296 | * The full expiration check is for this purpose now. |
296 | */ | 297 | */ |
297 | static void ip_vs_lblc_check_expire(unsigned long data) | 298 | static void ip_vs_lblc_check_expire(struct timer_list *t) |
298 | { | 299 | { |
299 | struct ip_vs_service *svc = (struct ip_vs_service *) data; | 300 | struct ip_vs_lblc_table *tbl = from_timer(tbl, t, periodic_timer); |
300 | struct ip_vs_lblc_table *tbl = svc->sched_data; | 301 | struct ip_vs_service *svc = tbl->svc; |
301 | unsigned long now = jiffies; | 302 | unsigned long now = jiffies; |
302 | int goal; | 303 | int goal; |
303 | int i, j; | 304 | int i, j; |
@@ -369,12 +370,12 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc) | |||
369 | tbl->rover = 0; | 370 | tbl->rover = 0; |
370 | tbl->counter = 1; | 371 | tbl->counter = 1; |
371 | tbl->dead = 0; | 372 | tbl->dead = 0; |
373 | tbl->svc = svc; | ||
372 | 374 | ||
373 | /* | 375 | /* |
374 | * Hook periodic timer for garbage collection | 376 | * Hook periodic timer for garbage collection |
375 | */ | 377 | */ |
376 | setup_timer(&tbl->periodic_timer, ip_vs_lblc_check_expire, | 378 | timer_setup(&tbl->periodic_timer, ip_vs_lblc_check_expire, 0); |
377 | (unsigned long)svc); | ||
378 | mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL); | 379 | mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL); |
379 | 380 | ||
380 | return 0; | 381 | return 0; |
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index c13ff575f9f7..84c57b62a588 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c | |||
@@ -278,6 +278,7 @@ struct ip_vs_lblcr_table { | |||
278 | atomic_t entries; /* number of entries */ | 278 | atomic_t entries; /* number of entries */ |
279 | int max_size; /* maximum size of entries */ | 279 | int max_size; /* maximum size of entries */ |
280 | struct timer_list periodic_timer; /* collect stale entries */ | 280 | struct timer_list periodic_timer; /* collect stale entries */ |
281 | struct ip_vs_service *svc; /* pointer back to service */ | ||
281 | int rover; /* rover for expire check */ | 282 | int rover; /* rover for expire check */ |
282 | int counter; /* counter for no expire */ | 283 | int counter; /* counter for no expire */ |
283 | bool dead; | 284 | bool dead; |
@@ -458,10 +459,10 @@ static inline void ip_vs_lblcr_full_check(struct ip_vs_service *svc) | |||
458 | * of the table. | 459 | * of the table. |
459 | * The full expiration check is for this purpose now. | 460 | * The full expiration check is for this purpose now. |
460 | */ | 461 | */ |
461 | static void ip_vs_lblcr_check_expire(unsigned long data) | 462 | static void ip_vs_lblcr_check_expire(struct timer_list *t) |
462 | { | 463 | { |
463 | struct ip_vs_service *svc = (struct ip_vs_service *) data; | 464 | struct ip_vs_lblcr_table *tbl = from_timer(tbl, t, periodic_timer); |
464 | struct ip_vs_lblcr_table *tbl = svc->sched_data; | 465 | struct ip_vs_service *svc = tbl->svc; |
465 | unsigned long now = jiffies; | 466 | unsigned long now = jiffies; |
466 | int goal; | 467 | int goal; |
467 | int i, j; | 468 | int i, j; |
@@ -532,12 +533,12 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc) | |||
532 | tbl->rover = 0; | 533 | tbl->rover = 0; |
533 | tbl->counter = 1; | 534 | tbl->counter = 1; |
534 | tbl->dead = 0; | 535 | tbl->dead = 0; |
536 | tbl->svc = svc; | ||
535 | 537 | ||
536 | /* | 538 | /* |
537 | * Hook periodic timer for garbage collection | 539 | * Hook periodic timer for garbage collection |
538 | */ | 540 | */ |
539 | setup_timer(&tbl->periodic_timer, ip_vs_lblcr_check_expire, | 541 | timer_setup(&tbl->periodic_timer, ip_vs_lblcr_check_expire, 0); |
540 | (unsigned long)svc); | ||
541 | mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL); | 542 | mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL); |
542 | 543 | ||
543 | return 0; | 544 | return 0; |