summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2006-10-28 10:38:23 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-28 11:30:50 -0700
commit2ae88149a27cadf2840e0ab8155bef13be285c03 (patch)
treee6873cc050973db6f2b01568a5e1faa6c981d139 /include
parent858cbcdd4f7a235f609249b9ca681b7ec5d786a3 (diff)
downloadblackbird-op-linux-2ae88149a27cadf2840e0ab8155bef13be285c03.tar.gz
blackbird-op-linux-2ae88149a27cadf2840e0ab8155bef13be285c03.zip
[PATCH] mm: clean up pagecache allocation
- Consolidate page_cache_alloc - Fix splice: only the pagecache pages and filesystem data need to use mapping_gfp_mask. - Fix grab_cache_page_nowait: same as splice, also honour NUMA placement. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pagemap.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 64f950925151..c3e255bf8594 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -52,19 +52,23 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
void release_pages(struct page **pages, int nr, int cold);
#ifdef CONFIG_NUMA
-extern struct page *page_cache_alloc(struct address_space *x);
-extern struct page *page_cache_alloc_cold(struct address_space *x);
+extern struct page *__page_cache_alloc(gfp_t gfp);
#else
+static inline struct page *__page_cache_alloc(gfp_t gfp)
+{
+ return alloc_pages(gfp, 0);
+}
+#endif
+
static inline struct page *page_cache_alloc(struct address_space *x)
{
- return alloc_pages(mapping_gfp_mask(x), 0);
+ return __page_cache_alloc(mapping_gfp_mask(x));
}
static inline struct page *page_cache_alloc_cold(struct address_space *x)
{
- return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0);
+ return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD);
}
-#endif
typedef int filler_t(void *, struct page *);
OpenPOWER on IntegriCloud