Use the cpu alloc functions for the mib handling functions in the net
layer. The API for snmp_mib_free() is changed to add a size parameter
since cpu_free() requires a size parameter.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/net/ip.h | 2 +-
include/net/snmp.h | 32 ++++++++------------------------
net/dccp/proto.c | 2 +-
net/ipv4/af_inet.c | 31 +++++++++++++++++--------------
net/ipv6/addrconf.c | 11 ++++++-----
net/ipv6/af_inet6.c | 20 +++++++++++---------
net/sctp/protocol.c | 2 +-
net/xfrm/xfrm_proc.c | 4 ++--
8 files changed, 47 insertions(+), 57 deletions(-)
Index: linux-2.6/include/net/ip.h
===================================================================
--- linux-2.6.orig/include/net/ip.h 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/include/net/ip.h 2008-05-29 20:15:34.000000000 -0700
@@ -170,7 +170,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_
extern unsigned long snmp_fold_field(void *mib[], int offt);
extern int snmp_mib_init(void *ptr[2], size_t mibsize);
-extern void snmp_mib_free(void *ptr[2]);
+extern void snmp_mib_free(void *ptr[2], size_t mibsize);
extern void inet_get_local_port_range(int *low, int *high);
Index: linux-2.6/include/net/snmp.h
===================================================================
--- linux-2.6.orig/include/net/snmp.h 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/include/net/snmp.h 2008-05-29 20:15:34.000000000 -0700
@@ -138,29 +138,13 @@ struct linux_xfrm_mib {
#define SNMP_STAT_BHPTR(name) (name[0])
#define SNMP_STAT_USRPTR(name) (name[1])
-#define SNMP_INC_STATS_BH(mib, field) \
- (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field]++)
-#define SNMP_INC_STATS_USER(mib, field) \
- do { \
- per_cpu_ptr(mib[1], get_cpu())->mibs[field]++; \
- put_cpu(); \
- } while (0)
-#define SNMP_INC_STATS(mib, field) \
- do { \
- per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]++; \
- put_cpu(); \
- } while (0)
-#define ...