Skip to content

Commit

Permalink
NFS: nfs_show_stats; for_each_possible_cpu(), not NR_CPUS
Browse files Browse the repository at this point in the history
Convert a for-loop that explicitly references "NR_CPUS" into the
potentially more efficient for_each_possible_cpu() construct.

Signed-off-by: John Hawkes <hawkes@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
John Hawkes authored and Trond Myklebust committed Apr 19, 2006
1 parent ec535ce commit b9d9506
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,12 +700,9 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
/*
* Display superblock I/O counters
*/
for (cpu = 0; cpu < NR_CPUS; cpu++) {
for_each_possible_cpu(cpu) {
struct nfs_iostats *stats;

if (!cpu_possible(cpu))
continue;

preempt_disable();
stats = per_cpu_ptr(nfss->io_stats, cpu);

Expand Down

0 comments on commit b9d9506

Please sign in to comment.