netns xfrm: fix "ip xfrm state|policy count" misreport
[safe/jmp/linux-2.6] / mm / mmzone.c
index 486ed59..f5b7d17 100644 (file)
@@ -6,6 +6,7 @@
 
 
 #include <linux/stddef.h>
+#include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/module.h>
 
@@ -69,6 +70,20 @@ struct zoneref *next_zones_zonelist(struct zoneref *z,
                                (z->zone && !zref_in_nodemask(z, nodes)))
                        z++;
 
-       *zone = zonelist_zone(z++);
+       *zone = zonelist_zone(z);
        return z;
 }
+
+#ifdef CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
+int memmap_valid_within(unsigned long pfn,
+                                       struct page *page, struct zone *zone)
+{
+       if (page_to_pfn(page) != pfn)
+               return 0;
+
+       if (page_zone(page) != zone)
+               return 0;
+
+       return 1;
+}
+#endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */