diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-03-02 04:37:13 -0800 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-03-02 04:37:13 -0800 |
| commit | 37c8cc306af4c48b60fcc33d0296e477e73ef3a8 (patch) | |
| tree | cbc399fa3b25298f1923151330b2febe0f76b3c1 | |
| parent | 0355478a390846d493d71727301c42f4494362d1 (diff) | |
[PATCH] clean up redundant code for alloc_pages
Patch from Matthew Dobson <colpatch@us.ibm.com>
Consolidate alloc_pages() and alloc_pages_node(). There is no change in
sizeof(vmlinux).
| -rw-r--r-- | include/linux/gfp.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index c9fb5039e753..c475f7b41e59 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -49,24 +49,16 @@ extern struct page * FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *)); static inline struct page * alloc_pages_node(int nid, unsigned int gfp_mask, unsigned int order) { - struct pglist_data *pgdat = NODE_DATA(nid); - unsigned int idx = (gfp_mask & GFP_ZONEMASK); - if (unlikely(order >= MAX_ORDER)) return NULL; - return __alloc_pages(gfp_mask, order, pgdat->node_zonelists + idx); -} -static inline struct page * alloc_pages(unsigned int gfp_mask, unsigned int order) -{ - struct pglist_data *pgdat = NODE_DATA(numa_node_id()); - unsigned int idx = (gfp_mask & GFP_ZONEMASK); - if (unlikely(order >= MAX_ORDER)) - return NULL; - return __alloc_pages(gfp_mask, order, pgdat->node_zonelists + idx); + return __alloc_pages(gfp_mask, order, NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK)); } -#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) +#define alloc_pages(gfp_mask, order) \ + alloc_pages_node(numa_node_id(), gfp_mask, order) +#define alloc_page(gfp_mask) \ + alloc_pages_node(numa_node_id(), gfp_mask, 0) extern unsigned long FASTCALL(__get_free_pages(unsigned int gfp_mask, unsigned int order)); extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask)); |
