[IPV6] SNMP: Move some statistic bits to net/ipv6/proc.c.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Fri, 20 Apr 2007 22:56:48 +0000 (15:56 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:29:11 +0000 (22:29 -0700)
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/af_inet6.c
net/ipv6/proc.c

index df31cdd33cdade02166cc3ca07c4b3487977d1f7..825d03e87ae01bc4c763f5c4c9cf1c59b51a5364 100644 (file)
@@ -712,39 +712,6 @@ int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL(ipv6_opt_accepted);
 
-int
-snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign)
-{
-       if (ptr == NULL)
-               return -EINVAL;
-
-       ptr[0] = __alloc_percpu(mibsize);
-       if (!ptr[0])
-               goto err0;
-
-       ptr[1] = __alloc_percpu(mibsize);
-       if (!ptr[1])
-               goto err1;
-
-       return 0;
-
-err1:
-       free_percpu(ptr[0]);
-       ptr[0] = NULL;
-err0:
-       return -ENOMEM;
-}
-
-void
-snmp6_mib_free(void *ptr[2])
-{
-       if (ptr == NULL)
-               return;
-       free_percpu(ptr[0]);
-       free_percpu(ptr[1]);
-       ptr[0] = ptr[1] = NULL;
-}
-
 static int __init init_ipv6_mibs(void)
 {
        if (snmp6_mib_init((void **)ipv6_statistics, sizeof (struct ipstats_mib),
index 0dc551501519ae02fa40b257dc925f49e845f303..5c3ce1c687c9d641041ac6ee6902180782e9d7c4 100644 (file)
@@ -346,4 +346,34 @@ int snmp6_free_dev(struct inet6_dev *idev)
        return 0;
 }
 
+int snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign)
+{
+       if (ptr == NULL)
+               return -EINVAL;
+
+       ptr[0] = __alloc_percpu(mibsize);
+       if (!ptr[0])
+               goto err0;
+
+       ptr[1] = __alloc_percpu(mibsize);
+       if (!ptr[1])
+               goto err1;
+
+       return 0;
+
+err1:
+       free_percpu(ptr[0]);
+       ptr[0] = NULL;
+err0:
+       return -ENOMEM;
+}
+
+void snmp6_mib_free(void *ptr[2])
+{
+       if (ptr == NULL)
+               return;
+       free_percpu(ptr[0]);
+       free_percpu(ptr[1]);
+       ptr[0] = ptr[1] = NULL;
+}