diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2007-04-21 02:56:48 +0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 09:29:11 +0400 |
commit | 49ed67a9eee3c756263feed4474e4fcf5c8eaed2 (patch) | |
tree | 41e989b08578e3a76c055c3f45ae4fc24dae59a2 /net/ipv6/proc.c | |
parent | bf99f1bde3b3009af74874f3465f6861431fbb66 (diff) | |
download | linux-49ed67a9eee3c756263feed4474e4fcf5c8eaed2.tar.xz |
[IPV6] SNMP: Move some statistic bits to net/ipv6/proc.c.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r-- | net/ipv6/proc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 0dc551501519..5c3ce1c687c9 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; +} |