[RFC v1 13/19] mm, page_alloc: use first_node in local_memory_node()

Pengfei Li
2019-11-21T15:21:49Z

In local_memory_node(), we want to access first node instead of
first zone, so use first_node_nlist instead of first_zone_nlist.

Signed-off-by: Pengfei Li <fly@kernel.page>
---
mm/page_alloc.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index aa5c2ef4f8ec..5c96d1ecd643 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5673,12 +5673,8 @@ static void build_zonelists(pg_data_t *pgdat)
*/
int local_memory_node(int node)
{
- struct zone *zone;
-
- zone = first_zone_nlist_nodemask(node_nodelist(node, GFP_KERNEL),
- gfp_zone(GFP_KERNEL),
- NULL);
- return zone_to_nid(zone);
+ return first_node_nlist_nodemask(node_nodelist(node, GFP_KERNEL),
+ gfp_zone(GFP_KERNEL), NULL);
}
#endif

--
2.23.0