Commit 8dae6768 authored by Andrew Morton's avatar Andrew Morton Committed by Dave Jones

[PATCH] make add_to_swap_cache() static

From: Hugh Dickins <hugh@veritas.com>

Make add_to_swap_cache static, it's only used by read_swap_cache_async;
and since that has just done a GFP_HIGHUSER allocation, surely it's
better for add_to_swap_cache to use GFP_KERNEL than GFP_ATOMIC.
parent 09efe93d
...@@ -200,7 +200,6 @@ extern int rw_swap_page_sync(int, swp_entry_t, struct page *); ...@@ -200,7 +200,6 @@ extern int rw_swap_page_sync(int, swp_entry_t, struct page *);
extern struct address_space swapper_space; extern struct address_space swapper_space;
#define total_swapcache_pages swapper_space.nrpages #define total_swapcache_pages swapper_space.nrpages
extern void show_swap_cache_info(void); extern void show_swap_cache_info(void);
extern int add_to_swap_cache(struct page *, swp_entry_t);
extern int add_to_swap(struct page *); extern int add_to_swap(struct page *);
extern void __delete_from_swap_cache(struct page *); extern void __delete_from_swap_cache(struct page *);
extern void delete_from_swap_cache(struct page *); extern void delete_from_swap_cache(struct page *);
......
...@@ -68,7 +68,7 @@ void show_swap_cache_info(void) ...@@ -68,7 +68,7 @@ void show_swap_cache_info(void)
swap_cache_info.noent_race, swap_cache_info.exist_race); swap_cache_info.noent_race, swap_cache_info.exist_race);
} }
int add_to_swap_cache(struct page *page, swp_entry_t entry) static int add_to_swap_cache(struct page *page, swp_entry_t entry)
{ {
int error; int error;
...@@ -78,7 +78,7 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry) ...@@ -78,7 +78,7 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry)
INC_CACHE_INFO(noent_race); INC_CACHE_INFO(noent_race);
return -ENOENT; return -ENOENT;
} }
error = add_to_page_cache(page, &swapper_space, entry.val, GFP_ATOMIC); error = add_to_page_cache(page, &swapper_space, entry.val, GFP_KERNEL);
/* /*
* Anon pages are already on the LRU, we don't run lru_cache_add here. * Anon pages are already on the LRU, we don't run lru_cache_add here.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment