X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=mm%2Fpage_isolation.c;h=5e0ffd967452083c8209dfa0a1334416ded99f68;hb=03fb3d2af96c2783c3a5bc03f3d984cf422f0e69;hp=3444b58033c87e4263c1d2f1db79f8f416580a29;hpb=dbc0e4cefd003834440fe7ac5464616c5235cb94;p=safe%2Fjmp%2Flinux-2.6 diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 3444b58..5e0ffd9 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -2,7 +2,6 @@ * linux/mm/page_isolation.c */ -#include #include #include #include @@ -115,8 +114,10 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn) int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) { - unsigned long pfn; + unsigned long pfn, flags; struct page *page; + struct zone *zone; + int ret; pfn = start_pfn; /* @@ -129,10 +130,13 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) if (page && get_pageblock_migratetype(page) != MIGRATE_ISOLATE) break; } - if (pfn < end_pfn) + page = __first_valid_page(start_pfn, end_pfn - start_pfn); + if ((pfn < end_pfn) || !page) return -EBUSY; /* Check all pages are free or Marked as ISOLATED */ - if (__test_page_isolated_in_pageblock(start_pfn, end_pfn)) - return 0; - return -EBUSY; + zone = page_zone(page); + spin_lock_irqsave(&zone->lock, flags); + ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn); + spin_unlock_irqrestore(&zone->lock, flags); + return ret ? 0 : -EBUSY; }