]> err.no Git - linux-2.6/blobdiff - mm/vmstat.c
[PATCH] Drop get_zone_counts()
[linux-2.6] / mm / vmstat.c
index 5462106725d719de129ec92ec5d8bd977cad6a29..5ffa8c27ead81ea6837675c5b0d70e9405dbc329 100644 (file)
 #include <linux/module.h>
 #include <linux/cpu.h>
 
-void __get_zone_counts(unsigned long *active, unsigned long *inactive,
-                       unsigned long *free, struct pglist_data *pgdat)
-{
-       struct zone *zones = pgdat->node_zones;
-       int i;
-
-       *active = node_page_state(pgdat->node_id, NR_ACTIVE);
-       *inactive = node_page_state(pgdat->node_id, NR_INACTIVE);
-       *free = 0;
-       for (i = 0; i < MAX_NR_ZONES; i++) {
-               *free += zones[i].free_pages;
-       }
-}
-
-void get_zone_counts(unsigned long *active,
-               unsigned long *inactive, unsigned long *free)
-{
-       struct pglist_data *pgdat;
-
-       *active = global_page_state(NR_ACTIVE);
-       *inactive = global_page_state(NR_INACTIVE);
-       *free = 0;
-       for_each_online_pgdat(pgdat) {
-               unsigned long l, m, n;
-               __get_zone_counts(&l, &m, &n, pgdat);
-               *free += n;
-       }
-}
-
 #ifdef CONFIG_VM_EVENT_COUNTERS
 DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
 EXPORT_PER_CPU_SYMBOL(vm_event_states);
@@ -454,16 +425,17 @@ const struct seq_operations fragmentation_op = {
 
 static const char * const vmstat_text[] = {
        /* Zoned VM counters */
+       "nr_free_pages",
        "nr_active",
        "nr_inactive",
        "nr_anon_pages",
        "nr_mapped",
        "nr_file_pages",
+       "nr_dirty",
+       "nr_writeback",
        "nr_slab_reclaimable",
        "nr_slab_unreclaimable",
        "nr_page_table_pages",
-       "nr_dirty",
-       "nr_writeback",
        "nr_unstable",
        "nr_bounce",
        "nr_vmscan_write",
@@ -534,7 +506,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg)
                           "\n        scanned  %lu (a: %lu i: %lu)"
                           "\n        spanned  %lu"
                           "\n        present  %lu",
-                          zone->free_pages,
+                          zone_page_state(zone, NR_FREE_PAGES),
                           zone->pages_min,
                           zone->pages_low,
                           zone->pages_high,