Commit a4dd0360 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Simon Horman

ipvs: Pass ipvs not net to ip_vs_estimator_net_init and ip_vs_estimator_cleanup

Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 70a131a2
...@@ -1323,7 +1323,7 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp) ...@@ -1323,7 +1323,7 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp)
} }
/* IPVS netns init & cleanup functions */ /* IPVS netns init & cleanup functions */
int ip_vs_estimator_net_init(struct net *net); int ip_vs_estimator_net_init(struct netns_ipvs *ipvs);
int ip_vs_control_net_init(struct netns_ipvs *ipvs); int ip_vs_control_net_init(struct netns_ipvs *ipvs);
int ip_vs_protocol_net_init(struct net *net); int ip_vs_protocol_net_init(struct net *net);
int ip_vs_app_net_init(struct net *net); int ip_vs_app_net_init(struct net *net);
...@@ -1333,7 +1333,7 @@ void ip_vs_conn_net_cleanup(struct net *net); ...@@ -1333,7 +1333,7 @@ void ip_vs_conn_net_cleanup(struct net *net);
void ip_vs_app_net_cleanup(struct net *net); void ip_vs_app_net_cleanup(struct net *net);
void ip_vs_protocol_net_cleanup(struct net *net); void ip_vs_protocol_net_cleanup(struct net *net);
void ip_vs_control_net_cleanup(struct netns_ipvs *ipvs); void ip_vs_control_net_cleanup(struct netns_ipvs *ipvs);
void ip_vs_estimator_net_cleanup(struct net *net); void ip_vs_estimator_net_cleanup(struct netns_ipvs *ipvs);
void ip_vs_sync_net_cleanup(struct netns_ipvs *ipvs); void ip_vs_sync_net_cleanup(struct netns_ipvs *ipvs);
void ip_vs_service_net_cleanup(struct netns_ipvs *ipvs); void ip_vs_service_net_cleanup(struct netns_ipvs *ipvs);
......
...@@ -2072,7 +2072,7 @@ static int __net_init __ip_vs_init(struct net *net) ...@@ -2072,7 +2072,7 @@ static int __net_init __ip_vs_init(struct net *net)
atomic_inc(&ipvs_netns_cnt); atomic_inc(&ipvs_netns_cnt);
net->ipvs = ipvs; net->ipvs = ipvs;
if (ip_vs_estimator_net_init(net) < 0) if (ip_vs_estimator_net_init(ipvs) < 0)
goto estimator_fail; goto estimator_fail;
if (ip_vs_control_net_init(ipvs) < 0) if (ip_vs_control_net_init(ipvs) < 0)
...@@ -2106,7 +2106,7 @@ static int __net_init __ip_vs_init(struct net *net) ...@@ -2106,7 +2106,7 @@ static int __net_init __ip_vs_init(struct net *net)
protocol_fail: protocol_fail:
ip_vs_control_net_cleanup(ipvs); ip_vs_control_net_cleanup(ipvs);
control_fail: control_fail:
ip_vs_estimator_net_cleanup(net); ip_vs_estimator_net_cleanup(ipvs);
estimator_fail: estimator_fail:
net->ipvs = NULL; net->ipvs = NULL;
return -ENOMEM; return -ENOMEM;
...@@ -2121,7 +2121,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net) ...@@ -2121,7 +2121,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
ip_vs_app_net_cleanup(net); ip_vs_app_net_cleanup(net);
ip_vs_protocol_net_cleanup(net); ip_vs_protocol_net_cleanup(net);
ip_vs_control_net_cleanup(ipvs); ip_vs_control_net_cleanup(ipvs);
ip_vs_estimator_net_cleanup(net); ip_vs_estimator_net_cleanup(ipvs);
IP_VS_DBG(2, "ipvs netns %d released\n", ipvs->gen); IP_VS_DBG(2, "ipvs netns %d released\n", ipvs->gen);
net->ipvs = NULL; net->ipvs = NULL;
} }
......
...@@ -188,10 +188,8 @@ void ip_vs_read_estimator(struct ip_vs_kstats *dst, struct ip_vs_stats *stats) ...@@ -188,10 +188,8 @@ void ip_vs_read_estimator(struct ip_vs_kstats *dst, struct ip_vs_stats *stats)
dst->outbps = (e->outbps + 0xF) >> 5; dst->outbps = (e->outbps + 0xF) >> 5;
} }
int __net_init ip_vs_estimator_net_init(struct net *net) int __net_init ip_vs_estimator_net_init(struct netns_ipvs *ipvs)
{ {
struct netns_ipvs *ipvs = net_ipvs(net);
INIT_LIST_HEAD(&ipvs->est_list); INIT_LIST_HEAD(&ipvs->est_list);
spin_lock_init(&ipvs->est_lock); spin_lock_init(&ipvs->est_lock);
setup_timer(&ipvs->est_timer, estimation_timer, (unsigned long)ipvs); setup_timer(&ipvs->est_timer, estimation_timer, (unsigned long)ipvs);
...@@ -199,7 +197,7 @@ int __net_init ip_vs_estimator_net_init(struct net *net) ...@@ -199,7 +197,7 @@ int __net_init ip_vs_estimator_net_init(struct net *net)
return 0; return 0;
} }
void __net_exit ip_vs_estimator_net_cleanup(struct net *net) void __net_exit ip_vs_estimator_net_cleanup(struct netns_ipvs *ipvs)
{ {
del_timer_sync(&net_ipvs(net)->est_timer); del_timer_sync(&ipvs->est_timer);
} }
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