From 1b1c5738315cfef1c9fd57df4e4b1b9c84c94be7 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Tue, 6 Nov 2007 11:33:54 -0800 Subject: [PATCH] cpu alloc: NFS statistics Signed-off-by: Christoph Lameter --- fs/nfs/iostat.h | 9 +++++---- fs/nfs/super.c | 2 +- include/linux/neighbour.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/nfs/iostat.h b/fs/nfs/iostat.h index 6350ecb..241b233 100644 --- a/fs/nfs/iostat.h +++ b/fs/nfs/iostat.h @@ -20,6 +20,7 @@ #ifndef _NFS_IOSTAT #define _NFS_IOSTAT +#include #define NFS_IOSTAT_VERS "1.0" @@ -123,7 +124,7 @@ static inline void nfs_inc_server_stats(struct nfs_server *server, enum nfs_stat int cpu; cpu = get_cpu(); - iostats = per_cpu_ptr(server->io_stats, cpu); + iostats = CPU_PTR(server->io_stats, cpu); iostats->events[stat] ++; put_cpu_no_resched(); } @@ -139,7 +140,7 @@ static inline void nfs_add_server_stats(struct nfs_server *server, enum nfs_stat int cpu; cpu = get_cpu(); - iostats = per_cpu_ptr(server->io_stats, cpu); + iostats = CPU_PTR(server->io_stats, cpu); iostats->bytes[stat] += addend; put_cpu_no_resched(); } @@ -151,13 +152,13 @@ static inline void nfs_add_stats(struct inode *inode, enum nfs_stat_bytecounters static inline struct nfs_iostats *nfs_alloc_iostats(void) { - return alloc_percpu(struct nfs_iostats); + return CPU_ALLOC(struct nfs_iostats, GFP_KERNEL | __GFP_ZERO); } static inline void nfs_free_iostats(struct nfs_iostats *stats) { if (stats != NULL) - free_percpu(stats); + CPU_FREE(stats); } #endif diff --git a/fs/nfs/super.c b/fs/nfs/super.c index fa517ae..2491bda 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -529,7 +529,7 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt) struct nfs_iostats *stats; preempt_disable(); - stats = per_cpu_ptr(nfss->io_stats, cpu); + stats = CPU_PTR(nfss->io_stats, cpu); for (i = 0; i < __NFSIOS_COUNTSMAX; i++) totals.events[i] += stats->events[i]; diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h index bd3bbf6..6298dd7 100644 --- a/include/linux/neighbour.h +++ b/include/linux/neighbour.h @@ -2,6 +2,7 @@ #define __LINUX_NEIGHBOUR_H #include +#include struct ndmsg { -- 1.5.3.4