Commit 07252dfe authored by Kefeng Wang's avatar Kefeng Wang Committed by Andrew Morton
Browse files

mm: use is_zone_movable_page() helper

parent 11680763
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -862,8 +862,7 @@ static void virtio_mem_sbm_notify_online(struct virtio_mem *vm,
					 unsigned long mb_id,
					 unsigned long start_pfn)
{
	const bool is_movable = page_zonenum(pfn_to_page(start_pfn)) ==
				ZONE_MOVABLE;
	const bool is_movable = is_zone_movable_page(pfn_to_page(start_pfn));
	int new_state;

	switch (virtio_mem_sbm_get_mb_state(vm, mb_id)) {
@@ -1158,8 +1157,7 @@ static void virtio_mem_fake_online(unsigned long pfn, unsigned long nr_pages)
 */
static int virtio_mem_fake_offline(unsigned long pfn, unsigned long nr_pages)
{
	const bool is_movable = page_zonenum(pfn_to_page(pfn)) ==
				ZONE_MOVABLE;
	const bool is_movable = is_zone_movable_page(pfn_to_page(pfn));
	int rc, retry_count;

	/*
+1 −1
Original line number Diff line number Diff line
@@ -932,7 +932,7 @@ static struct zone *auto_movable_zone_for_pfn(int nid,
			if (!page)
				continue;
			/* If anything is !MOVABLE online the rest !MOVABLE. */
			if (page_zonenum(page) != ZONE_MOVABLE)
			if (!is_zone_movable_page(page))
				goto kernel_zone;
			online_pages += PAGES_PER_SECTION;
		}