Skip to content

Commit 503cf15

Browse files
HSchillhorms
authored andcommitted
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>
1 parent ed78bec commit 503cf15

8 files changed

Lines changed: 51 additions & 51 deletions

File tree

‎include/net/ip_vs.h‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,19 +1087,19 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp)
10871087
/*
10881088
* IPVS netns init & cleanup functions
10891089
*/
1090-
extern int __ip_vs_estimator_init(struct net *net);
1091-
extern int __ip_vs_control_init(struct net *net);
1092-
extern int __ip_vs_protocol_init(struct net *net);
1093-
extern int __ip_vs_app_init(struct net *net);
1094-
extern int __ip_vs_conn_init(struct net *net);
1095-
extern int __ip_vs_sync_init(struct net *net);
1096-
extern void __ip_vs_conn_cleanup(struct net *net);
1097-
extern void __ip_vs_app_cleanup(struct net *net);
1098-
extern void __ip_vs_protocol_cleanup(struct net *net);
1099-
extern void __ip_vs_control_cleanup(struct net *net);
1100-
extern void __ip_vs_estimator_cleanup(struct net *net);
1101-
extern void __ip_vs_sync_cleanup(struct net *net);
1102-
extern void __ip_vs_service_cleanup(struct net *net);
1090+
extern int ip_vs_estimator_net_init(struct net *net);
1091+
extern int ip_vs_control_net_init(struct net *net);
1092+
extern int ip_vs_protocol_net_init(struct net *net);
1093+
extern int ip_vs_app_net_init(struct net *net);
1094+
extern int ip_vs_conn_net_init(struct net *net);
1095+
extern int ip_vs_sync_net_init(struct net *net);
1096+
extern void ip_vs_conn_net_cleanup(struct net *net);
1097+
extern void ip_vs_app_net_cleanup(struct net *net);
1098+
extern void ip_vs_protocol_net_cleanup(struct net *net);
1099+
extern void ip_vs_control_net_cleanup(struct net *net);
1100+
extern void ip_vs_estimator_net_cleanup(struct net *net);
1101+
extern void ip_vs_sync_net_cleanup(struct net *net);
1102+
extern void ip_vs_service_net_cleanup(struct net *net);
11031103

11041104
/*
11051105
* IPVS application functions

‎net/netfilter/ipvs/ip_vs_app.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ static const struct file_operations ip_vs_app_fops = {
576576
};
577577
#endif
578578

579-
int __net_init __ip_vs_app_init(struct net *net)
579+
int __net_init ip_vs_app_net_init(struct net *net)
580580
{
581581
struct netns_ipvs *ipvs = net_ipvs(net);
582582

@@ -585,7 +585,7 @@ int __net_init __ip_vs_app_init(struct net *net)
585585
return 0;
586586
}
587587

588-
void __net_exit __ip_vs_app_cleanup(struct net *net)
588+
void __net_exit ip_vs_app_net_cleanup(struct net *net)
589589
{
590590
proc_net_remove(net, "ip_vs_app");
591591
}

‎net/netfilter/ipvs/ip_vs_conn.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ static void ip_vs_conn_flush(struct net *net)
12471247
/*
12481248
* per netns init and exit
12491249
*/
1250-
int __net_init __ip_vs_conn_init(struct net *net)
1250+
int __net_init ip_vs_conn_net_init(struct net *net)
12511251
{
12521252
struct netns_ipvs *ipvs = net_ipvs(net);
12531253

@@ -1258,7 +1258,7 @@ int __net_init __ip_vs_conn_init(struct net *net)
12581258
return 0;
12591259
}
12601260

1261-
void __net_exit __ip_vs_conn_cleanup(struct net *net)
1261+
void __net_exit ip_vs_conn_net_cleanup(struct net *net)
12621262
{
12631263
/* flush all the connection entries first */
12641264
ip_vs_conn_flush(net);

‎net/netfilter/ipvs/ip_vs_core.c‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,22 +1891,22 @@ static int __net_init __ip_vs_init(struct net *net)
18911891
atomic_inc(&ipvs_netns_cnt);
18921892
net->ipvs = ipvs;
18931893

1894-
if (__ip_vs_estimator_init(net) < 0)
1894+
if (ip_vs_estimator_net_init(net) < 0)
18951895
goto estimator_fail;
18961896

1897-
if (__ip_vs_control_init(net) < 0)
1897+
if (ip_vs_control_net_init(net) < 0)
18981898
goto control_fail;
18991899

1900-
if (__ip_vs_protocol_init(net) < 0)
1900+
if (ip_vs_protocol_net_init(net) < 0)
19011901
goto protocol_fail;
19021902

1903-
if (__ip_vs_app_init(net) < 0)
1903+
if (ip_vs_app_net_init(net) < 0)
19041904
goto app_fail;
19051905

1906-
if (__ip_vs_conn_init(net) < 0)
1906+
if (ip_vs_conn_net_init(net) < 0)
19071907
goto conn_fail;
19081908

1909-
if (__ip_vs_sync_init(net) < 0)
1909+
if (ip_vs_sync_net_init(net) < 0)
19101910
goto sync_fail;
19111911

19121912
printk(KERN_INFO "IPVS: Creating netns size=%zu id=%d\n",
@@ -1917,35 +1917,35 @@ static int __net_init __ip_vs_init(struct net *net)
19171917
*/
19181918

19191919
sync_fail:
1920-
__ip_vs_conn_cleanup(net);
1920+
ip_vs_conn_net_cleanup(net);
19211921
conn_fail:
1922-
__ip_vs_app_cleanup(net);
1922+
ip_vs_app_net_cleanup(net);
19231923
app_fail:
1924-
__ip_vs_protocol_cleanup(net);
1924+
ip_vs_protocol_net_cleanup(net);
19251925
protocol_fail:
1926-
__ip_vs_control_cleanup(net);
1926+
ip_vs_control_net_cleanup(net);
19271927
control_fail:
1928-
__ip_vs_estimator_cleanup(net);
1928+
ip_vs_estimator_net_cleanup(net);
19291929
estimator_fail:
19301930
return -ENOMEM;
19311931
}
19321932

19331933
static void __net_exit __ip_vs_cleanup(struct net *net)
19341934
{
1935-
__ip_vs_service_cleanup(net); /* ip_vs_flush() with locks */
1936-
__ip_vs_conn_cleanup(net);
1937-
__ip_vs_app_cleanup(net);
1938-
__ip_vs_protocol_cleanup(net);
1939-
__ip_vs_control_cleanup(net);
1940-
__ip_vs_estimator_cleanup(net);
1935+
ip_vs_service_net_cleanup(net); /* ip_vs_flush() with locks */
1936+
ip_vs_conn_net_cleanup(net);
1937+
ip_vs_app_net_cleanup(net);
1938+
ip_vs_protocol_net_cleanup(net);
1939+
ip_vs_control_net_cleanup(net);
1940+
ip_vs_estimator_net_cleanup(net);
19411941
IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
19421942
}
19431943

19441944
static void __net_exit __ip_vs_dev_cleanup(struct net *net)
19451945
{
19461946
EnterFunction(2);
19471947
net_ipvs(net)->enable = 0; /* Disable packet reception */
1948-
__ip_vs_sync_cleanup(net);
1948+
ip_vs_sync_net_cleanup(net);
19491949
LeaveFunction(2);
19501950
}
19511951

‎net/netfilter/ipvs/ip_vs_ctl.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ static int ip_vs_flush(struct net *net)
14831483
* Delete service by {netns} in the service table.
14841484
* Called by __ip_vs_cleanup()
14851485
*/
1486-
void __ip_vs_service_cleanup(struct net *net)
1486+
void ip_vs_service_net_cleanup(struct net *net)
14871487
{
14881488
EnterFunction(2);
14891489
/* Check for "full" addressed entries */
@@ -1662,7 +1662,7 @@ proc_do_sync_mode(ctl_table *table, int write,
16621662
/*
16631663
* IPVS sysctl table (under the /proc/sys/net/ipv4/vs/)
16641664
* Do not change order or insert new entries without
1665-
* align with netns init in __ip_vs_control_init()
1665+
* align with netns init in ip_vs_control_net_init()
16661666
*/
16671667

16681668
static struct ctl_table vs_vars[] = {
@@ -3595,7 +3595,7 @@ static void ip_vs_genl_unregister(void)
35953595
* per netns intit/exit func.
35963596
*/
35973597
#ifdef CONFIG_SYSCTL
3598-
int __net_init __ip_vs_control_init_sysctl(struct net *net)
3598+
int __net_init ip_vs_control_net_init_sysctl(struct net *net)
35993599
{
36003600
int idx;
36013601
struct netns_ipvs *ipvs = net_ipvs(net);
@@ -3654,7 +3654,7 @@ int __net_init __ip_vs_control_init_sysctl(struct net *net)
36543654
return 0;
36553655
}
36563656

3657-
void __net_init __ip_vs_control_cleanup_sysctl(struct net *net)
3657+
void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net)
36583658
{
36593659
struct netns_ipvs *ipvs = net_ipvs(net);
36603660

@@ -3665,16 +3665,16 @@ void __net_init __ip_vs_control_cleanup_sysctl(struct net *net)
36653665

36663666
#else
36673667

3668-
int __net_init __ip_vs_control_init_sysctl(struct net *net) { return 0; }
3669-
void __net_init __ip_vs_control_cleanup_sysctl(struct net *net) { }
3668+
int __net_init ip_vs_control_net_init_sysctl(struct net *net) { return 0; }
3669+
void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net) { }
36703670

36713671
#endif
36723672

36733673
static struct notifier_block ip_vs_dst_notifier = {
36743674
.notifier_call = ip_vs_dst_event,
36753675
};
36763676

3677-
int __net_init __ip_vs_control_init(struct net *net)
3677+
int __net_init ip_vs_control_net_init(struct net *net)
36783678
{
36793679
int idx;
36803680
struct netns_ipvs *ipvs = net_ipvs(net);
@@ -3702,7 +3702,7 @@ int __net_init __ip_vs_control_init(struct net *net)
37023702
proc_net_fops_create(net, "ip_vs_stats_percpu", 0,
37033703
&ip_vs_stats_percpu_fops);
37043704

3705-
if (__ip_vs_control_init_sysctl(net))
3705+
if (ip_vs_control_net_init_sysctl(net))
37063706
goto err;
37073707

37083708
return 0;
@@ -3712,13 +3712,13 @@ int __net_init __ip_vs_control_init(struct net *net)
37123712
return -ENOMEM;
37133713
}
37143714

3715-
void __net_exit __ip_vs_control_cleanup(struct net *net)
3715+
void __net_exit ip_vs_control_net_cleanup(struct net *net)
37163716
{
37173717
struct netns_ipvs *ipvs = net_ipvs(net);
37183718

37193719
ip_vs_trash_cleanup(net);
37203720
ip_vs_stop_estimator(net, &ipvs->tot_stats);
3721-
__ip_vs_control_cleanup_sysctl(net);
3721+
ip_vs_control_net_cleanup_sysctl(net);
37223722
proc_net_remove(net, "ip_vs_stats_percpu");
37233723
proc_net_remove(net, "ip_vs_stats");
37243724
proc_net_remove(net, "ip_vs");

‎net/netfilter/ipvs/ip_vs_est.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void ip_vs_read_estimator(struct ip_vs_stats_user *dst,
192192
dst->outbps = (e->outbps + 0xF) >> 5;
193193
}
194194

195-
int __net_init __ip_vs_estimator_init(struct net *net)
195+
int __net_init ip_vs_estimator_net_init(struct net *net)
196196
{
197197
struct netns_ipvs *ipvs = net_ipvs(net);
198198

@@ -203,7 +203,7 @@ int __net_init __ip_vs_estimator_init(struct net *net)
203203
return 0;
204204
}
205205

206-
void __net_exit __ip_vs_estimator_cleanup(struct net *net)
206+
void __net_exit ip_vs_estimator_net_cleanup(struct net *net)
207207
{
208208
del_timer_sync(&net_ipvs(net)->est_timer);
209209
}

‎net/netfilter/ipvs/ip_vs_proto.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
316316
/*
317317
* per network name-space init
318318
*/
319-
int __net_init __ip_vs_protocol_init(struct net *net)
319+
int __net_init ip_vs_protocol_net_init(struct net *net)
320320
{
321321
#ifdef CONFIG_IP_VS_PROTO_TCP
322322
register_ip_vs_proto_netns(net, &ip_vs_protocol_tcp);
@@ -336,7 +336,7 @@ int __net_init __ip_vs_protocol_init(struct net *net)
336336
return 0;
337337
}
338338

339-
void __net_exit __ip_vs_protocol_cleanup(struct net *net)
339+
void __net_exit ip_vs_protocol_net_cleanup(struct net *net)
340340
{
341341
struct netns_ipvs *ipvs = net_ipvs(net);
342342
struct ip_vs_proto_data *pd;

‎net/netfilter/ipvs/ip_vs_sync.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ int stop_sync_thread(struct net *net, int state)
16631663
/*
16641664
* Initialize data struct for each netns
16651665
*/
1666-
int __net_init __ip_vs_sync_init(struct net *net)
1666+
int __net_init ip_vs_sync_net_init(struct net *net)
16671667
{
16681668
struct netns_ipvs *ipvs = net_ipvs(net);
16691669

@@ -1677,7 +1677,7 @@ int __net_init __ip_vs_sync_init(struct net *net)
16771677
return 0;
16781678
}
16791679

1680-
void __ip_vs_sync_cleanup(struct net *net)
1680+
void ip_vs_sync_net_cleanup(struct net *net)
16811681
{
16821682
int retc;
16831683

0 commit comments

Comments
 (0)