diff options
Diffstat (limited to 'mm/filemap_xip.c')
-rw-r--r-- | mm/filemap_xip.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c index e233fff61b4b..f874ae818ad3 100644 --- a/mm/filemap_xip.c +++ b/mm/filemap_xip.c | |||
@@ -25,14 +25,15 @@ static struct page *__xip_sparse_page; | |||
25 | static struct page *xip_sparse_page(void) | 25 | static struct page *xip_sparse_page(void) |
26 | { | 26 | { |
27 | if (!__xip_sparse_page) { | 27 | if (!__xip_sparse_page) { |
28 | unsigned long zeroes = get_zeroed_page(GFP_HIGHUSER); | 28 | struct page *page = alloc_page(GFP_HIGHUSER | __GFP_ZERO); |
29 | if (zeroes) { | 29 | |
30 | if (page) { | ||
30 | static DEFINE_SPINLOCK(xip_alloc_lock); | 31 | static DEFINE_SPINLOCK(xip_alloc_lock); |
31 | spin_lock(&xip_alloc_lock); | 32 | spin_lock(&xip_alloc_lock); |
32 | if (!__xip_sparse_page) | 33 | if (!__xip_sparse_page) |
33 | __xip_sparse_page = virt_to_page(zeroes); | 34 | __xip_sparse_page = page; |
34 | else | 35 | else |
35 | free_page(zeroes); | 36 | __free_page(page); |
36 | spin_unlock(&xip_alloc_lock); | 37 | spin_unlock(&xip_alloc_lock); |
37 | } | 38 | } |
38 | } | 39 | } |