include/linux/gfp.h cleanup for NUMA API
Subsystems (2)
PATCH 1/1 include/linux/gfp.h cleanup for NUMA API
Andi,
Here's a few cleanups to include/linux/gfp.h
1) Move the extern of alloc_pages_current() into #ifdef CONFIG_NUMA. The only references to the function are in NUMA code in mempolicy.c
2) Remove the definitions of __alloc_page_vma(). They aren't used.
3) Move forward declaration of struct vm_area_struct to top of file.
-Matt
include/linux/gfp.h +6 -7
@@ -6,6 +6,8 @@#include <linux/linkage.h> #include <linux/config.h> +struct vm_area_struct ; +/* * GFP bitmasks.. */
@@ -84,10 +86,9 @@ static inline struct page *alloc_pages_n NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK)); } +#ifdef CONFIG_NUMA extern struct page *alloc_pages_current (unsigned gfp_mask,unsigned order); -struct vm_area_struct ; -#ifdef CONFIG_NUMA static inline struct page *alloc_pages (unsigned int gfp_mask,unsigned int order) {
@@ -96,17 +97,15 @@ alloc_pages(unsigned int gfp_mask, unsig return alloc_pages_current(gfp_mask, order); } -extern struct page *__alloc_page_vma (unsigned gfp_mask, -struct vm_area_struct *vma,unsigned long off);extern struct page *alloc_page_vma (unsigned gfp_mask,struct vm_area_struct *vma,unsigned long addr); -#else +#else /* !CONFIG_NUMA */ #define alloc_pages (gfp_mask, order) \ alloc_pages_node(numa_node_id(), gfp_mask, order)#define alloc_page_vma (gfp_mask, vma, addr) alloc_pages(gfp_mask, 0) -#define __alloc_page_vma (gfp_mask, vma, addr) alloc_pages(gfp_mask, 0) -#endif +#endif /* CONFIG_NUMA */ +#define alloc_page (gfp_mask) alloc_pages(gfp_mask, 0)extern unsigned long FASTCALL (__get_free_pages (unsigned int gfp_mask,unsigned int order));
Quoted 9 lines · Matthew Dobson
Andi,
Here's a few cleanups toinclude/linux/gfp.h1) Move the extern of
alloc_pages_current()into #ifdefCONFIG_NUMA. The only references to the function are in NUMA code inmempolicy.c2) Remove the definitions of
__alloc_page_vma(). They aren't used.3) Move forward declaration of struct
vm_area_structto top of file.
I already did (2). Rest looks ok too.
-Andi