[PATCH] include/linux/gfp.h cleanup for NUMA API

From: Matthew Dobson
Date: Wed Apr 21 2004 - 17:07:36 EST


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 diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.6-rc1-mm1/include/linux/gfp.h linux-2.6.6-cleanup-gfp_h/include/linux/gfp.h
--- linux-2.6.6-rc1-mm1/include/linux/gfp.h 2004-04-20 14:29:11.000000000 -0700
+++ linux-2.6.6-cleanup-gfp_h/include/linux/gfp.h 2004-04-21 14:47:11.000000000 -0700
@@ -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));