diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-10-07 20:39:04 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-07 20:39:04 -0700 |
| commit | e175e9b2497bf5cfc159b305b22bdc59c743e370 (patch) | |
| tree | 3c718f33e65973ef25104a60cba79abf7706ff3d /include/linux | |
| parent | 15e28e8d45273677a31fad76102acc3bc4cf88f6 (diff) | |
[PATCH] numa: alloc_pages_node cleanup
Patch from Christoph Hellwig
It turns alloc_pages_node into a static inline, in the same fashion as
alloc_pages. There is no need for #ifdef CONFIG_NUMA in the patch, as
the numa node identification functions are sensible enough to do the
right thing for non-NUMA systems. Moves alloc_pages_node from numa.c
to gfp.h, and removes the EXPORT_SYMBOL which is no longer needed as
this is now an inline.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/gfp.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 966344dff4b4..939f16910233 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -38,8 +38,6 @@ * can allocate highmem pages, the *get*page*() variants return * virtual kernel addresses to the allocated page(s). */ -extern struct page * FASTCALL(__alloc_pages(unsigned int gfp_mask, unsigned int order, struct zonelist *zonelist)); -extern struct page * alloc_pages_node(int nid, unsigned int gfp_mask, unsigned int order); /* * We get the zone list from the current node and the gfp_mask. @@ -48,14 +46,23 @@ extern struct page * alloc_pages_node(int nid, unsigned int gfp_mask, unsigned i * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets * optimized to &contig_page_data at compile-time. */ -static inline struct page * alloc_pages(unsigned int gfp_mask, unsigned int order) +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) { - pg_data_t *pgdat = NODE_DATA(numa_node_id()); + 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); } |
