summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-01-05 03:51:29 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-01-05 03:51:29 -0800
commitc3ed96a73eb9bd1ef08f5138129c6f1a93923430 (patch)
tree166ff49c0413c5eff80f2c6a473485d266ca7aa2 /include/linux
parent9fb6fde975800f1275d466775913b175cd039044 (diff)
[PATCH] handle radix_tree_node allocation failures
This patch uses the radix_tree_preload() API in add_to_page_cache(). A new gfp_mask argument is added to add_to_page_cache(), which is then passed on to radix_tree_preload(). It's pretty simple. In the case of adding pages to swapcache we're still using GFP_ATOMIC, so these addition attempts can still fail. That's OK, because the error is handled and, unlike file pages, it will not cause user applicaton failures. This codepath (radix-tree node exhaustion on swapout) was well tested in the days when the swapper_space radix tree was fragmented all over the place due to unfortunate swp_entry bit layout.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pagemap.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 9707f467b2be..1a297ca9d00a 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -66,10 +66,10 @@ extern struct page * read_cache_page(struct address_space *mapping,
extern int read_cache_pages(struct address_space *mapping,
struct list_head *pages, filler_t *filler, void *data);
-extern int add_to_page_cache(struct page *page,
- struct address_space *mapping, unsigned long index);
-extern int add_to_page_cache_lru(struct page *page,
- struct address_space *mapping, unsigned long index);
+int add_to_page_cache(struct page *page, struct address_space *mapping,
+ unsigned long index, int gfp_mask);
+int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
+ unsigned long index, int gfp_mask);
extern void remove_from_page_cache(struct page *page);
extern void __remove_from_page_cache(struct page *page);