From 0e88460da6ab7bb6a7ef83675412ed5b6315d741 Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Mon, 28 Apr 2008 02:12:14 -0700 Subject: mm: introduce node_zonelist() for accessing the zonelist for a GFP mask Introduce a node_zonelist() helper function. It is used to lookup the appropriate zonelist given a node and a GFP mask. The patch on its own is a cleanup but it helps clarify parts of the two-zonelist-per-node patchset. If necessary, it can be merged with the next patch in this set without problems. Reviewed-by: Christoph Lameter Signed-off-by: Mel Gorman Signed-off-by: Lee Schermerhorn Cc: KAMEZAWA Hiroyuki Cc: Mel Gorman Cc: Christoph Lameter Cc: Hugh Dickins Cc: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/buffer.c') diff --git a/fs/buffer.c b/fs/buffer.c index 1dae94acb3fe..71358499bc57 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -361,13 +361,13 @@ void invalidate_bdev(struct block_device *bdev) static void free_more_memory(void) { struct zonelist *zonelist; - pg_data_t *pgdat; + int nid; wakeup_pdflush(1024); yield(); - for_each_online_pgdat(pgdat) { - zonelist = &pgdat->node_zonelists[gfp_zone(GFP_NOFS)]; + for_each_online_node(nid) { + zonelist = node_zonelist(nid, GFP_NOFS); if (zonelist->zones[0]) try_to_free_pages(zonelist, 0, GFP_NOFS); } -- cgit v1.2.3