aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/proto.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-03-21 00:24:42 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 00:24:42 -0500
commit46f09ffa7db595f49fb42338e013417756816d37 (patch)
tree95d286df35f404bd61680c10d1c6e69521e727de /net/dccp/proto.c
parent075ae86611011e1acdda9df6a7e30f8508b31fd6 (diff)
[DCCP]: Rename init_dccp_v4_mibs to dccp_mib_init
And introduce dccp_mib_exit grouping previously open coded sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r--net/dccp/proto.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 3ba1ff435798..abab6c10af96 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -933,7 +933,7 @@ void dccp_ctl_sock_exit(void)
933EXPORT_SYMBOL_GPL(dccp_ctl_sock_exit); 933EXPORT_SYMBOL_GPL(dccp_ctl_sock_exit);
934#endif 934#endif
935 935
936static int __init init_dccp_v4_mibs(void) 936static int __init dccp_mib_init(void)
937{ 937{
938 int rc = -ENOMEM; 938 int rc = -ENOMEM;
939 939
@@ -955,6 +955,13 @@ out_free_one:
955 955
956} 956}
957 957
958static int dccp_mib_exit(void)
959{
960 free_percpu(dccp_statistics[0]);
961 free_percpu(dccp_statistics[1]);
962 dccp_statistics[0] = dccp_statistics[1] = NULL;
963}
964
958static int thash_entries; 965static int thash_entries;
959module_param(thash_entries, int, 0444); 966module_param(thash_entries, int, 0444);
960MODULE_PARM_DESC(thash_entries, "Number of ehash buckets"); 967MODULE_PARM_DESC(thash_entries, "Number of ehash buckets");
@@ -1044,7 +1051,7 @@ static int __init dccp_init(void)
1044 INIT_HLIST_HEAD(&dccp_hashinfo.bhash[i].chain); 1051 INIT_HLIST_HEAD(&dccp_hashinfo.bhash[i].chain);
1045 } 1052 }
1046 1053
1047 rc = init_dccp_v4_mibs(); 1054 rc = dccp_mib_init();
1048 if (rc) 1055 if (rc)
1049 goto out_free_dccp_bhash; 1056 goto out_free_dccp_bhash;
1050 1057
@@ -1075,9 +1082,7 @@ out_unregister_protosw:
1075 inet_unregister_protosw(&dccp_v4_protosw); 1082 inet_unregister_protosw(&dccp_v4_protosw);
1076 inet_del_protocol(&dccp_protocol, IPPROTO_DCCP); 1083 inet_del_protocol(&dccp_protocol, IPPROTO_DCCP);
1077out_free_dccp_v4_mibs: 1084out_free_dccp_v4_mibs:
1078 free_percpu(dccp_statistics[0]); 1085 dccp_mib_exit();
1079 free_percpu(dccp_statistics[1]);
1080 dccp_statistics[0] = dccp_statistics[1] = NULL;
1081out_free_dccp_bhash: 1086out_free_dccp_bhash:
1082 free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); 1087 free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order);
1083 dccp_hashinfo.bhash = NULL; 1088 dccp_hashinfo.bhash = NULL;
@@ -1102,8 +1107,7 @@ static void __exit dccp_fini(void)
1102 if (inet_del_protocol(&dccp_protocol, IPPROTO_DCCP) < 0) 1107 if (inet_del_protocol(&dccp_protocol, IPPROTO_DCCP) < 0)
1103 printk(dccp_del_proto_err_msg); 1108 printk(dccp_del_proto_err_msg);
1104 1109
1105 free_percpu(dccp_statistics[0]); 1110 dccp_mib_exit();
1106 free_percpu(dccp_statistics[1]);
1107 free_pages((unsigned long)dccp_hashinfo.bhash, 1111 free_pages((unsigned long)dccp_hashinfo.bhash,
1108 get_order(dccp_hashinfo.bhash_size * 1112 get_order(dccp_hashinfo.bhash_size *
1109 sizeof(struct inet_bind_hashbucket))); 1113 sizeof(struct inet_bind_hashbucket)));