]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/buffer.c
mm: have zonelist contains structs with both a zone pointer and zone_idx
[mirror_ubuntu-bionic-kernel.git] / fs / buffer.c
index 1dae94acb3fe618343c721dd0cfdf7f66fa5f9dc..ac84cd13075d60142002897661ba067d60b65239 100644 (file)
@@ -360,16 +360,18 @@ void invalidate_bdev(struct block_device *bdev)
  */
 static void free_more_memory(void)
 {
-       struct zonelist *zonelist;
-       pg_data_t *pgdat;
+       struct zoneref *zrefs;
+       int nid;
 
        wakeup_pdflush(1024);
        yield();
 
-       for_each_online_pgdat(pgdat) {
-               zonelist = &pgdat->node_zonelists[gfp_zone(GFP_NOFS)];
-               if (zonelist->zones[0])
-                       try_to_free_pages(zonelist, 0, GFP_NOFS);
+       for_each_online_node(nid) {
+               zrefs = first_zones_zonelist(node_zonelist(nid, GFP_NOFS),
+                                               gfp_zone(GFP_NOFS));
+               if (zrefs->zone)
+                       try_to_free_pages(node_zonelist(nid, GFP_NOFS), 0,
+                                               GFP_NOFS);
        }
 }