From 49ed67a9eee3c756263feed4474e4fcf5c8eaed2 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Fri, 20 Apr 2007 15:56:48 -0700 Subject: [IPV6] SNMP: Move some statistic bits to net/ipv6/proc.c. Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- net/ipv6/proc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'net/ipv6/proc.c') diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 0dc55150151..5c3ce1c687c 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c @@ -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; +} -- cgit v1.2.3-70-g09d2