]> Git Repo - linux.git/commitdiff
xip: fix get_zeroed_page with __GFP_HIGHMEM
authorAkinobu Mita <[email protected]>
Tue, 8 Jan 2008 23:32:57 +0000 (15:32 -0800)
committerLinus Torvalds <[email protected]>
Wed, 9 Jan 2008 00:10:36 +0000 (16:10 -0800)
The use of get_zeroed_page() with __GFP_HIGHMEM is invalid.  Use
alloc_page() with __GFP_ZERO instead of invalid get_zeroed_page().

(This patch is only compile tested)

Cc: Carsten Otte <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Acked-by: Hugh Dickins <[email protected]>
Acked-by: Carsten Otte <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/filemap_xip.c

index e233fff61b4bd036382a26811849653ebfd4b9e5..f874ae818ad3812f7cd051972c823c743a154d33 100644 (file)
@@ -25,14 +25,15 @@ static struct page *__xip_sparse_page;
 static struct page *xip_sparse_page(void)
 {
        if (!__xip_sparse_page) {
-               unsigned long zeroes = get_zeroed_page(GFP_HIGHUSER);
-               if (zeroes) {
+               struct page *page = alloc_page(GFP_HIGHUSER | __GFP_ZERO);
+
+               if (page) {
                        static DEFINE_SPINLOCK(xip_alloc_lock);
                        spin_lock(&xip_alloc_lock);
                        if (!__xip_sparse_page)
-                               __xip_sparse_page = virt_to_page(zeroes);
+                               __xip_sparse_page = page;
                        else
-                               free_page(zeroes);
+                               __free_page(page);
                        spin_unlock(&xip_alloc_lock);
                }
        }
This page took 0.05214 seconds and 4 git commands to generate.