[PATCH] m32r: Fix M32104 cache flushing routines
[linux-2.6.git] / arch / m32r / mm / init.c
index bc423d8..6facf15 100644 (file)
@@ -48,8 +48,10 @@ void show_mem(void)
        show_free_areas();
        printk("Free swap:       %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
        for_each_pgdat(pgdat) {
+               unsigned long flags;
+               pgdat_resize_lock(pgdat, &flags);
                for (i = 0; i < pgdat->node_spanned_pages; ++i) {
-                       page = pgdat->node_mem_map + i;
+                       page = pgdat_page_nr(pgdat, i);
                        total++;
                        if (PageHighMem(page))
                                highmem++;
@@ -60,6 +62,7 @@ void show_mem(void)
                        else if (page_count(page))
                                shared += page_count(page) - 1;
                }
+               pgdat_resize_unlock(pgdat, &flags);
        }
        printk("%d pages of RAM\n", total);
        printk("%d pages of HIGHMEM\n",highmem);
@@ -150,10 +153,14 @@ int __init reservedpages_count(void)
        int reservedpages, nid, i;
 
        reservedpages = 0;
-       for_each_online_node(nid)
+       for_each_online_node(nid) {
+               unsigned long flags;
+               pgdat_resize_lock(NODE_DATA(nid), &flags);
                for (i = 0 ; i < MAX_LOW_PFN(nid) - START_PFN(nid) ; i++)
-                       if (PageReserved(NODE_DATA(nid)->node_mem_map + i))
+                       if (PageReserved(nid_page_nr(nid, i)))
                                reservedpages++;
+               pgdat_resize_unlock(NODE_DATA(nid), &flags);
+       }
 
        return reservedpages;
 }