diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index afda8fd16484..81926c7ef6f0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1922,31 +1922,25 @@ EXPORT_SYMBOL(__alloc_pages_nodemask); | |||
1922 | */ | 1922 | */ |
1923 | unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order) | 1923 | unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order) |
1924 | { | 1924 | { |
1925 | struct page * page; | 1925 | struct page *page; |
1926 | |||
1927 | /* | ||
1928 | * __get_free_pages() returns a 32-bit address, which cannot represent | ||
1929 | * a highmem page | ||
1930 | */ | ||
1931 | VM_BUG_ON((gfp_mask & __GFP_HIGHMEM) != 0); | ||
1932 | |||
1926 | page = alloc_pages(gfp_mask, order); | 1933 | page = alloc_pages(gfp_mask, order); |
1927 | if (!page) | 1934 | if (!page) |
1928 | return 0; | 1935 | return 0; |
1929 | return (unsigned long) page_address(page); | 1936 | return (unsigned long) page_address(page); |
1930 | } | 1937 | } |
1931 | |||
1932 | EXPORT_SYMBOL(__get_free_pages); | 1938 | EXPORT_SYMBOL(__get_free_pages); |
1933 | 1939 | ||
1934 | unsigned long get_zeroed_page(gfp_t gfp_mask) | 1940 | unsigned long get_zeroed_page(gfp_t gfp_mask) |
1935 | { | 1941 | { |
1936 | struct page * page; | 1942 | return __get_free_pages(gfp_mask | __GFP_ZERO, 0); |
1937 | |||
1938 | /* | ||
1939 | * get_zeroed_page() returns a 32-bit address, which cannot represent | ||
1940 | * a highmem page | ||
1941 | */ | ||
1942 | VM_BUG_ON((gfp_mask & __GFP_HIGHMEM) != 0); | ||
1943 | |||
1944 | page = alloc_pages(gfp_mask | __GFP_ZERO, 0); | ||
1945 | if (page) | ||
1946 | return (unsigned long) page_address(page); | ||
1947 | return 0; | ||
1948 | } | 1943 | } |
1949 | |||
1950 | EXPORT_SYMBOL(get_zeroed_page); | 1944 | EXPORT_SYMBOL(get_zeroed_page); |
1951 | 1945 | ||
1952 | void __pagevec_free(struct pagevec *pvec) | 1946 | void __pagevec_free(struct pagevec *pvec) |