diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 13:10:26 +0900 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 13:10:26 +0900 |
| commit | 8181d3ef26ed1d9eb21e2cdcac374e1f457fdc06 (patch) | |
| tree | 1a081f09ebcf2a84de899ddeadd0e4c5e48b50d2 /drivers/base/node.c | |
| parent | sh: mark DMA slave ID 0 as invalid (diff) | |
| parent | Linux 3.0-rc1 (diff) | |
| download | linux-8181d3ef26ed1d9eb21e2cdcac374e1f457fdc06.tar.gz linux-8181d3ef26ed1d9eb21e2cdcac374e1f457fdc06.zip | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-fixes-for-linus
Diffstat (limited to 'drivers/base/node.c')
| -rw-r--r-- | drivers/base/node.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index b3b72d64e805..793f796c4da3 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -7,6 +7,7 @@ #include <linux/init.h> #include <linux/mm.h> #include <linux/memory.h> +#include <linux/vmstat.h> #include <linux/node.h> #include <linux/hugetlb.h> #include <linux/compaction.h> @@ -179,11 +180,14 @@ static ssize_t node_read_vmstat(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) { int nid = dev->id; - return sprintf(buf, - "nr_written %lu\n" - "nr_dirtied %lu\n", - node_page_state(nid, NR_WRITTEN), - node_page_state(nid, NR_DIRTIED)); + int i; + int n = 0; + + for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) + n += sprintf(buf+n, "%s %lu\n", vmstat_text[i], + node_page_state(nid, i)); + + return n; } static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL); |
