Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hans Schillstrom and committed by
Simon Horman
503cf15a ed78bec4

+51 -51
+13 -13
include/net/ip_vs.h
··· 1087 1087 /* 1088 1088 * IPVS netns init & cleanup functions 1089 1089 */ 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); 1103 1103 1104 1104 /* 1105 1105 * IPVS application functions
+2 -2
net/netfilter/ipvs/ip_vs_app.c
··· 576 576 }; 577 577 #endif 578 578 579 - int __net_init __ip_vs_app_init(struct net *net) 579 + int __net_init ip_vs_app_net_init(struct net *net) 580 580 { 581 581 struct netns_ipvs *ipvs = net_ipvs(net); 582 582 ··· 585 585 return 0; 586 586 } 587 587 588 - void __net_exit __ip_vs_app_cleanup(struct net *net) 588 + void __net_exit ip_vs_app_net_cleanup(struct net *net) 589 589 { 590 590 proc_net_remove(net, "ip_vs_app"); 591 591 }
+2 -2
net/netfilter/ipvs/ip_vs_conn.c
··· 1247 1247 /* 1248 1248 * per netns init and exit 1249 1249 */ 1250 - int __net_init __ip_vs_conn_init(struct net *net) 1250 + int __net_init ip_vs_conn_net_init(struct net *net) 1251 1251 { 1252 1252 struct netns_ipvs *ipvs = net_ipvs(net); 1253 1253 ··· 1258 1258 return 0; 1259 1259 } 1260 1260 1261 - void __net_exit __ip_vs_conn_cleanup(struct net *net) 1261 + void __net_exit ip_vs_conn_net_cleanup(struct net *net) 1262 1262 { 1263 1263 /* flush all the connection entries first */ 1264 1264 ip_vs_conn_flush(net);
+18 -18
net/netfilter/ipvs/ip_vs_core.c
··· 1891 1891 atomic_inc(&ipvs_netns_cnt); 1892 1892 net->ipvs = ipvs; 1893 1893 1894 - if (__ip_vs_estimator_init(net) < 0) 1894 + if (ip_vs_estimator_net_init(net) < 0) 1895 1895 goto estimator_fail; 1896 1896 1897 - if (__ip_vs_control_init(net) < 0) 1897 + if (ip_vs_control_net_init(net) < 0) 1898 1898 goto control_fail; 1899 1899 1900 - if (__ip_vs_protocol_init(net) < 0) 1900 + if (ip_vs_protocol_net_init(net) < 0) 1901 1901 goto protocol_fail; 1902 1902 1903 - if (__ip_vs_app_init(net) < 0) 1903 + if (ip_vs_app_net_init(net) < 0) 1904 1904 goto app_fail; 1905 1905 1906 - if (__ip_vs_conn_init(net) < 0) 1906 + if (ip_vs_conn_net_init(net) < 0) 1907 1907 goto conn_fail; 1908 1908 1909 - if (__ip_vs_sync_init(net) < 0) 1909 + if (ip_vs_sync_net_init(net) < 0) 1910 1910 goto sync_fail; 1911 1911 1912 1912 printk(KERN_INFO "IPVS: Creating netns size=%zu id=%d\n", ··· 1917 1917 */ 1918 1918 1919 1919 sync_fail: 1920 - __ip_vs_conn_cleanup(net); 1920 + ip_vs_conn_net_cleanup(net); 1921 1921 conn_fail: 1922 - __ip_vs_app_cleanup(net); 1922 + ip_vs_app_net_cleanup(net); 1923 1923 app_fail: 1924 - __ip_vs_protocol_cleanup(net); 1924 + ip_vs_protocol_net_cleanup(net); 1925 1925 protocol_fail: 1926 - __ip_vs_control_cleanup(net); 1926 + ip_vs_control_net_cleanup(net); 1927 1927 control_fail: 1928 - __ip_vs_estimator_cleanup(net); 1928 + ip_vs_estimator_net_cleanup(net); 1929 1929 estimator_fail: 1930 1930 return -ENOMEM; 1931 1931 } 1932 1932 1933 1933 static void __net_exit __ip_vs_cleanup(struct net *net) 1934 1934 { 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); 1941 1941 IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen); 1942 1942 } 1943 1943 ··· 1945 1945 { 1946 1946 EnterFunction(2); 1947 1947 net_ipvs(net)->enable = 0; /* Disable packet reception */ 1948 - __ip_vs_sync_cleanup(net); 1948 + ip_vs_sync_net_cleanup(net); 1949 1949 LeaveFunction(2); 1950 1950 } 1951 1951
+10 -10
net/netfilter/ipvs/ip_vs_ctl.c
··· 1483 1483 * Delete service by {netns} in the service table. 1484 1484 * Called by __ip_vs_cleanup() 1485 1485 */ 1486 - void __ip_vs_service_cleanup(struct net *net) 1486 + void ip_vs_service_net_cleanup(struct net *net) 1487 1487 { 1488 1488 EnterFunction(2); 1489 1489 /* Check for "full" addressed entries */ ··· 1662 1662 /* 1663 1663 * IPVS sysctl table (under the /proc/sys/net/ipv4/vs/) 1664 1664 * 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() 1666 1666 */ 1667 1667 1668 1668 static struct ctl_table vs_vars[] = { ··· 3595 3595 * per netns intit/exit func. 3596 3596 */ 3597 3597 #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) 3599 3599 { 3600 3600 int idx; 3601 3601 struct netns_ipvs *ipvs = net_ipvs(net); ··· 3654 3654 return 0; 3655 3655 } 3656 3656 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) 3658 3658 { 3659 3659 struct netns_ipvs *ipvs = net_ipvs(net); 3660 3660 ··· 3665 3665 3666 3666 #else 3667 3667 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) { } 3670 3670 3671 3671 #endif 3672 3672 ··· 3674 3674 .notifier_call = ip_vs_dst_event, 3675 3675 }; 3676 3676 3677 - int __net_init __ip_vs_control_init(struct net *net) 3677 + int __net_init ip_vs_control_net_init(struct net *net) 3678 3678 { 3679 3679 int idx; 3680 3680 struct netns_ipvs *ipvs = net_ipvs(net); ··· 3702 3702 proc_net_fops_create(net, "ip_vs_stats_percpu", 0, 3703 3703 &ip_vs_stats_percpu_fops); 3704 3704 3705 - if (__ip_vs_control_init_sysctl(net)) 3705 + if (ip_vs_control_net_init_sysctl(net)) 3706 3706 goto err; 3707 3707 3708 3708 return 0; ··· 3712 3712 return -ENOMEM; 3713 3713 } 3714 3714 3715 - void __net_exit __ip_vs_control_cleanup(struct net *net) 3715 + void __net_exit ip_vs_control_net_cleanup(struct net *net) 3716 3716 { 3717 3717 struct netns_ipvs *ipvs = net_ipvs(net); 3718 3718 3719 3719 ip_vs_trash_cleanup(net); 3720 3720 ip_vs_stop_estimator(net, &ipvs->tot_stats); 3721 - __ip_vs_control_cleanup_sysctl(net); 3721 + ip_vs_control_net_cleanup_sysctl(net); 3722 3722 proc_net_remove(net, "ip_vs_stats_percpu"); 3723 3723 proc_net_remove(net, "ip_vs_stats"); 3724 3724 proc_net_remove(net, "ip_vs");
+2 -2
net/netfilter/ipvs/ip_vs_est.c
··· 192 192 dst->outbps = (e->outbps + 0xF) >> 5; 193 193 } 194 194 195 - int __net_init __ip_vs_estimator_init(struct net *net) 195 + int __net_init ip_vs_estimator_net_init(struct net *net) 196 196 { 197 197 struct netns_ipvs *ipvs = net_ipvs(net); 198 198 ··· 203 203 return 0; 204 204 } 205 205 206 - void __net_exit __ip_vs_estimator_cleanup(struct net *net) 206 + void __net_exit ip_vs_estimator_net_cleanup(struct net *net) 207 207 { 208 208 del_timer_sync(&net_ipvs(net)->est_timer); 209 209 }
+2 -2
net/netfilter/ipvs/ip_vs_proto.c
··· 316 316 /* 317 317 * per network name-space init 318 318 */ 319 - int __net_init __ip_vs_protocol_init(struct net *net) 319 + int __net_init ip_vs_protocol_net_init(struct net *net) 320 320 { 321 321 #ifdef CONFIG_IP_VS_PROTO_TCP 322 322 register_ip_vs_proto_netns(net, &ip_vs_protocol_tcp); ··· 336 336 return 0; 337 337 } 338 338 339 - void __net_exit __ip_vs_protocol_cleanup(struct net *net) 339 + void __net_exit ip_vs_protocol_net_cleanup(struct net *net) 340 340 { 341 341 struct netns_ipvs *ipvs = net_ipvs(net); 342 342 struct ip_vs_proto_data *pd;
+2 -2
net/netfilter/ipvs/ip_vs_sync.c
··· 1663 1663 /* 1664 1664 * Initialize data struct for each netns 1665 1665 */ 1666 - int __net_init __ip_vs_sync_init(struct net *net) 1666 + int __net_init ip_vs_sync_net_init(struct net *net) 1667 1667 { 1668 1668 struct netns_ipvs *ipvs = net_ipvs(net); 1669 1669 ··· 1677 1677 return 0; 1678 1678 } 1679 1679 1680 - void __ip_vs_sync_cleanup(struct net *net) 1680 + void ip_vs_sync_net_cleanup(struct net *net) 1681 1681 { 1682 1682 int retc; 1683 1683