diff options
Diffstat (limited to 'mm/page_isolation.c')
-rw-r--r-- | mm/page_isolation.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 3444b58033c8..b70a7fec1ff6 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c | |||
@@ -2,7 +2,6 @@ | |||
2 | * linux/mm/page_isolation.c | 2 | * linux/mm/page_isolation.c |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <stddef.h> | ||
6 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
7 | #include <linux/page-isolation.h> | 6 | #include <linux/page-isolation.h> |
8 | #include <linux/pageblock-flags.h> | 7 | #include <linux/pageblock-flags.h> |
@@ -115,8 +114,10 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn) | |||
115 | 114 | ||
116 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) | 115 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) |
117 | { | 116 | { |
118 | unsigned long pfn; | 117 | unsigned long pfn, flags; |
119 | struct page *page; | 118 | struct page *page; |
119 | struct zone *zone; | ||
120 | int ret; | ||
120 | 121 | ||
121 | pfn = start_pfn; | 122 | pfn = start_pfn; |
122 | /* | 123 | /* |
@@ -132,7 +133,9 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) | |||
132 | if (pfn < end_pfn) | 133 | if (pfn < end_pfn) |
133 | return -EBUSY; | 134 | return -EBUSY; |
134 | /* Check all pages are free or Marked as ISOLATED */ | 135 | /* Check all pages are free or Marked as ISOLATED */ |
135 | if (__test_page_isolated_in_pageblock(start_pfn, end_pfn)) | 136 | zone = page_zone(pfn_to_page(pfn)); |
136 | return 0; | 137 | spin_lock_irqsave(&zone->lock, flags); |
137 | return -EBUSY; | 138 | ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn); |
139 | spin_unlock_irqrestore(&zone->lock, flags); | ||
140 | return ret ? 0 : -EBUSY; | ||
138 | } | 141 | } |