From: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> Switch __get_free_page() to be the implementation and __get_free_pages() to be the wrapper that calls __get_free_page() with the appropriate argument. Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> --- include/linux/gfp.h | 6 +++--- mm/page_alloc.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index faf3586419ce..dac282ac1158 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -536,15 +536,15 @@ extern struct page *alloc_pages_vma(gfp_t gfp, struct vm_area_struct *vma, #define alloc_page_vma_node(gfp_mask, vma, addr, node) \ alloc_pages_vma(gfp_mask, vma, addr, node, false) -extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); +extern unsigned long __get_free_page(gfp_t gfp_mask); extern unsigned long get_zeroed_page(gfp_t gfp_mask); void *alloc_pages_exact(size_t size, gfp_t gfp_mask); void free_pages_exact(void *virt, size_t size); void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask); -#define __get_free_page(gfp_mask) \ - __get_free_pages((gfp_mask), 0) +#define __get_free_pages(gfp_mask, order) \ + __get_free_page(gfp_mask | __GFP_ORDER(order)) #define __get_dma_pages(gfp_mask, order) \ __get_free_pages((gfp_mask) | GFP_DMA, (order)) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6e968ab91660..eefe3c81c383 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4693,16 +4693,16 @@ EXPORT_SYMBOL(__alloc_pages_nodemask); * address cannot represent highmem pages. Use alloc_pages and then kmap if * you need to access high mem. */ -unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order) +unsigned long __get_free_page(gfp_t gfp_mask) { struct page *page; - page = alloc_pages(gfp_mask & ~__GFP_HIGHMEM, order); + page = alloc_page(gfp_mask & ~__GFP_HIGHMEM); if (!page) return 0; return (unsigned long) page_address(page); } -EXPORT_SYMBOL(__get_free_pages); +EXPORT_SYMBOL(__get_free_page); unsigned long get_zeroed_page(gfp_t gfp_mask) { -- 2.20.1