IPVS: rename of netns init and cleanup functions.

Make it more clear what the functions does,
on request by Julian.

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
Hans Schillstrom 2011-05-01 18:50:16 +02:00 committed by Simon Horman
parent ed78bec4d6
commit 503cf15a5e
8 changed files with 51 additions and 51 deletions

View File

@ -1087,19 +1087,19 @@ 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
*/ */
extern int __ip_vs_estimator_init(struct net *net); extern int ip_vs_estimator_net_init(struct net *net);
extern int __ip_vs_control_init(struct net *net); extern int ip_vs_control_net_init(struct net *net);
extern int __ip_vs_protocol_init(struct net *net); extern int ip_vs_protocol_net_init(struct net *net);
extern int __ip_vs_app_init(struct net *net); extern int ip_vs_app_net_init(struct net *net);
extern int __ip_vs_conn_init(struct net *net); extern int ip_vs_conn_net_init(struct net *net);
extern int __ip_vs_sync_init(struct net *net); extern int ip_vs_sync_net_init(struct net *net);
extern void __ip_vs_conn_cleanup(struct net *net); extern void ip_vs_conn_net_cleanup(struct net *net);
extern void __ip_vs_app_cleanup(struct net *net); extern void ip_vs_app_net_cleanup(struct net *net);
extern void __ip_vs_protocol_cleanup(struct net *net); extern void ip_vs_protocol_net_cleanup(struct net *net);
extern void __ip_vs_control_cleanup(struct net *net); extern void ip_vs_control_net_cleanup(struct net *net);
extern void __ip_vs_estimator_cleanup(struct net *net); extern void ip_vs_estimator_net_cleanup(struct net *net);
extern void __ip_vs_sync_cleanup(struct net *net); extern void ip_vs_sync_net_cleanup(struct net *net);
extern void __ip_vs_service_cleanup(struct net *net); extern void ip_vs_service_net_cleanup(struct net *net);
/* /*
* IPVS application functions * IPVS application functions

View File

@ -576,7 +576,7 @@ static const struct file_operations ip_vs_app_fops = {
}; };
#endif #endif
int __net_init __ip_vs_app_init(struct net *net) int __net_init ip_vs_app_net_init(struct net *net)
{ {
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
@ -585,7 +585,7 @@ int __net_init __ip_vs_app_init(struct net *net)
return 0; return 0;
} }
void __net_exit __ip_vs_app_cleanup(struct net *net) void __net_exit ip_vs_app_net_cleanup(struct net *net)
{ {
proc_net_remove(net, "ip_vs_app"); proc_net_remove(net, "ip_vs_app");
} }

View File

@ -1247,7 +1247,7 @@ flush_again:
/* /*
* per netns init and exit * per netns init and exit
*/ */
int __net_init __ip_vs_conn_init(struct net *net) int __net_init ip_vs_conn_net_init(struct net *net)
{ {
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
@ -1258,7 +1258,7 @@ int __net_init __ip_vs_conn_init(struct net *net)
return 0; return 0;
} }
void __net_exit __ip_vs_conn_cleanup(struct net *net) void __net_exit ip_vs_conn_net_cleanup(struct net *net)
{ {
/* flush all the connection entries first */ /* flush all the connection entries first */
ip_vs_conn_flush(net); ip_vs_conn_flush(net);

View File

@ -1891,22 +1891,22 @@ 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_init(net) < 0) if (ip_vs_estimator_net_init(net) < 0)
goto estimator_fail; goto estimator_fail;
if (__ip_vs_control_init(net) < 0) if (ip_vs_control_net_init(net) < 0)
goto control_fail; goto control_fail;
if (__ip_vs_protocol_init(net) < 0) if (ip_vs_protocol_net_init(net) < 0)
goto protocol_fail; goto protocol_fail;
if (__ip_vs_app_init(net) < 0) if (ip_vs_app_net_init(net) < 0)
goto app_fail; goto app_fail;
if (__ip_vs_conn_init(net) < 0) if (ip_vs_conn_net_init(net) < 0)
goto conn_fail; goto conn_fail;
if (__ip_vs_sync_init(net) < 0) if (ip_vs_sync_net_init(net) < 0)
goto sync_fail; goto sync_fail;
printk(KERN_INFO "IPVS: Creating netns size=%zu id=%d\n", printk(KERN_INFO "IPVS: Creating netns size=%zu id=%d\n",
@ -1917,27 +1917,27 @@ static int __net_init __ip_vs_init(struct net *net)
*/ */
sync_fail: sync_fail:
__ip_vs_conn_cleanup(net); ip_vs_conn_net_cleanup(net);
conn_fail: conn_fail:
__ip_vs_app_cleanup(net); ip_vs_app_net_cleanup(net);
app_fail: app_fail:
__ip_vs_protocol_cleanup(net); ip_vs_protocol_net_cleanup(net);
protocol_fail: protocol_fail:
__ip_vs_control_cleanup(net); ip_vs_control_net_cleanup(net);
control_fail: control_fail:
__ip_vs_estimator_cleanup(net); ip_vs_estimator_net_cleanup(net);
estimator_fail: estimator_fail:
return -ENOMEM; return -ENOMEM;
} }
static void __net_exit __ip_vs_cleanup(struct net *net) static void __net_exit __ip_vs_cleanup(struct net *net)
{ {
__ip_vs_service_cleanup(net); /* ip_vs_flush() with locks */ ip_vs_service_net_cleanup(net); /* ip_vs_flush() with locks */
__ip_vs_conn_cleanup(net); ip_vs_conn_net_cleanup(net);
__ip_vs_app_cleanup(net); ip_vs_app_net_cleanup(net);
__ip_vs_protocol_cleanup(net); ip_vs_protocol_net_cleanup(net);
__ip_vs_control_cleanup(net); ip_vs_control_net_cleanup(net);
__ip_vs_estimator_cleanup(net); ip_vs_estimator_net_cleanup(net);
IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen); IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
} }
@ -1945,7 +1945,7 @@ static void __net_exit __ip_vs_dev_cleanup(struct net *net)
{ {
EnterFunction(2); EnterFunction(2);
net_ipvs(net)->enable = 0; /* Disable packet reception */ net_ipvs(net)->enable = 0; /* Disable packet reception */
__ip_vs_sync_cleanup(net); ip_vs_sync_net_cleanup(net);
LeaveFunction(2); LeaveFunction(2);
} }

View File

@ -1483,7 +1483,7 @@ static int ip_vs_flush(struct net *net)
* Delete service by {netns} in the service table. * Delete service by {netns} in the service table.
* Called by __ip_vs_cleanup() * Called by __ip_vs_cleanup()
*/ */
void __ip_vs_service_cleanup(struct net *net) void ip_vs_service_net_cleanup(struct net *net)
{ {
EnterFunction(2); EnterFunction(2);
/* Check for "full" addressed entries */ /* Check for "full" addressed entries */
@ -1662,7 +1662,7 @@ proc_do_sync_mode(ctl_table *table, int write,
/* /*
* IPVS sysctl table (under the /proc/sys/net/ipv4/vs/) * IPVS sysctl table (under the /proc/sys/net/ipv4/vs/)
* Do not change order or insert new entries without * Do not change order or insert new entries without
* align with netns init in __ip_vs_control_init() * align with netns init in ip_vs_control_net_init()
*/ */
static struct ctl_table vs_vars[] = { static struct ctl_table vs_vars[] = {
@ -3595,7 +3595,7 @@ static void ip_vs_genl_unregister(void)
* per netns intit/exit func. * per netns intit/exit func.
*/ */
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
int __net_init __ip_vs_control_init_sysctl(struct net *net) int __net_init ip_vs_control_net_init_sysctl(struct net *net)
{ {
int idx; int idx;
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
@ -3654,7 +3654,7 @@ int __net_init __ip_vs_control_init_sysctl(struct net *net)
return 0; return 0;
} }
void __net_init __ip_vs_control_cleanup_sysctl(struct net *net) void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net)
{ {
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
@ -3665,8 +3665,8 @@ void __net_init __ip_vs_control_cleanup_sysctl(struct net *net)
#else #else
int __net_init __ip_vs_control_init_sysctl(struct net *net) { return 0; } int __net_init ip_vs_control_net_init_sysctl(struct net *net) { return 0; }
void __net_init __ip_vs_control_cleanup_sysctl(struct net *net) { } void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net) { }
#endif #endif
@ -3674,7 +3674,7 @@ static struct notifier_block ip_vs_dst_notifier = {
.notifier_call = ip_vs_dst_event, .notifier_call = ip_vs_dst_event,
}; };
int __net_init __ip_vs_control_init(struct net *net) int __net_init ip_vs_control_net_init(struct net *net)
{ {
int idx; int idx;
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
@ -3702,7 +3702,7 @@ int __net_init __ip_vs_control_init(struct net *net)
proc_net_fops_create(net, "ip_vs_stats_percpu", 0, proc_net_fops_create(net, "ip_vs_stats_percpu", 0,
&ip_vs_stats_percpu_fops); &ip_vs_stats_percpu_fops);
if (__ip_vs_control_init_sysctl(net)) if (ip_vs_control_net_init_sysctl(net))
goto err; goto err;
return 0; return 0;
@ -3712,13 +3712,13 @@ err:
return -ENOMEM; return -ENOMEM;
} }
void __net_exit __ip_vs_control_cleanup(struct net *net) void __net_exit ip_vs_control_net_cleanup(struct net *net)
{ {
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
ip_vs_trash_cleanup(net); ip_vs_trash_cleanup(net);
ip_vs_stop_estimator(net, &ipvs->tot_stats); ip_vs_stop_estimator(net, &ipvs->tot_stats);
__ip_vs_control_cleanup_sysctl(net); ip_vs_control_net_cleanup_sysctl(net);
proc_net_remove(net, "ip_vs_stats_percpu"); proc_net_remove(net, "ip_vs_stats_percpu");
proc_net_remove(net, "ip_vs_stats"); proc_net_remove(net, "ip_vs_stats");
proc_net_remove(net, "ip_vs"); proc_net_remove(net, "ip_vs");

View File

@ -192,7 +192,7 @@ void ip_vs_read_estimator(struct ip_vs_stats_user *dst,
dst->outbps = (e->outbps + 0xF) >> 5; dst->outbps = (e->outbps + 0xF) >> 5;
} }
int __net_init __ip_vs_estimator_init(struct net *net) int __net_init ip_vs_estimator_net_init(struct net *net)
{ {
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
@ -203,7 +203,7 @@ int __net_init __ip_vs_estimator_init(struct net *net)
return 0; return 0;
} }
void __net_exit __ip_vs_estimator_cleanup(struct net *net) void __net_exit ip_vs_estimator_net_cleanup(struct net *net)
{ {
del_timer_sync(&net_ipvs(net)->est_timer); del_timer_sync(&net_ipvs(net)->est_timer);
} }

View File

@ -316,7 +316,7 @@ ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
/* /*
* per network name-space init * per network name-space init
*/ */
int __net_init __ip_vs_protocol_init(struct net *net) int __net_init ip_vs_protocol_net_init(struct net *net)
{ {
#ifdef CONFIG_IP_VS_PROTO_TCP #ifdef CONFIG_IP_VS_PROTO_TCP
register_ip_vs_proto_netns(net, &ip_vs_protocol_tcp); register_ip_vs_proto_netns(net, &ip_vs_protocol_tcp);
@ -336,7 +336,7 @@ int __net_init __ip_vs_protocol_init(struct net *net)
return 0; return 0;
} }
void __net_exit __ip_vs_protocol_cleanup(struct net *net) void __net_exit ip_vs_protocol_net_cleanup(struct net *net)
{ {
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_proto_data *pd; struct ip_vs_proto_data *pd;

View File

@ -1663,7 +1663,7 @@ int stop_sync_thread(struct net *net, int state)
/* /*
* Initialize data struct for each netns * Initialize data struct for each netns
*/ */
int __net_init __ip_vs_sync_init(struct net *net) int __net_init ip_vs_sync_net_init(struct net *net)
{ {
struct netns_ipvs *ipvs = net_ipvs(net); struct netns_ipvs *ipvs = net_ipvs(net);
@ -1677,7 +1677,7 @@ int __net_init __ip_vs_sync_init(struct net *net)
return 0; return 0;
} }
void __ip_vs_sync_cleanup(struct net *net) void ip_vs_sync_net_cleanup(struct net *net)
{ {
int retc; int retc;