X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fgfp.h;h=7851e6b520cf013f4091cd4932f69cb4b00e76b5;hb=a9e2ae39170d01937725e1fff2e606baaa71346c;hp=313dfe9b443abb0d98b890aae74158e580db3ba8;hpb=e1d7a2de6c4249072dd886c129410e11e637ceff;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 313dfe9b443..7851e6b520c 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -11,7 +11,7 @@ struct vm_area_struct; /* * GFP bitmasks.. */ -/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ +/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */ #define __GFP_DMA ((__force gfp_t)0x01u) #define __GFP_HIGHMEM ((__force gfp_t)0x02u) #ifdef CONFIG_DMA_IS_DMA32 @@ -57,6 +57,7 @@ struct vm_area_struct; __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ __GFP_NOMEMALLOC|__GFP_HARDWALL) +/* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) #define GFP_NOFS (__GFP_WAIT | __GFP_IO) @@ -74,7 +75,12 @@ struct vm_area_struct; #define GFP_DMA32 __GFP_DMA32 -#define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK)) +static inline int gfp_zone(gfp_t gfp) +{ + int zone = GFP_ZONEMASK & (__force int) gfp; + BUG_ON(zone >= GFP_ZONETYPES); + return zone; +} /* * There is only one page-allocator function, and two main namespaces to @@ -104,6 +110,10 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, if (unlikely(order >= MAX_ORDER)) return NULL; + /* Unknown node is current node */ + if (nid < 0) + nid = numa_node_id(); + return __alloc_pages(gfp_mask, order, NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask)); } @@ -147,9 +157,9 @@ extern void FASTCALL(free_cold_page(struct page *page)); void page_alloc_init(void); #ifdef CONFIG_NUMA -void drain_remote_pages(void); +void drain_node_pages(int node); #else -static inline void drain_remote_pages(void) { }; +static inline void drain_node_pages(int node) { }; #endif #endif /* __LINUX_GFP_H */