aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2008-02-05 01:28:41 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:14 -0500
commit46017e954826ac59e91df76341a3f76b45467847 (patch)
tree711a35e3936118665d0eac2afeef8758b4f4e95f /include/linux/swap.h
parentc4cc6d07b2f465fbf5efd99bbe772a49c515f3f2 (diff)
swapin_readahead: move and rearrange args
swapin_readahead has never sat well in mm/memory.c: move it to mm/swap_state.c beside its kindred read_swap_cache_async. Why were its args in a different order? rearrange them. And since it was always followed by a read_swap_cache_async of the target page, fold that in and return struct page*. Then CONFIG_SWAP=n no longer needs valid_swaphandles and read_swap_cache_async stubs. Signed-off-by: Hugh Dickins <hugh@veritas.com> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 4f3838adbb30..9fa1aef1b82c 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -158,9 +158,6 @@ struct swap_list_t {
158/* Swap 50% full? Release swapcache more aggressively.. */ 158/* Swap 50% full? Release swapcache more aggressively.. */
159#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) 159#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
160 160
161/* linux/mm/memory.c */
162extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
163
164/* linux/mm/page_alloc.c */ 161/* linux/mm/page_alloc.c */
165extern unsigned long totalram_pages; 162extern unsigned long totalram_pages;
166extern unsigned long totalreserve_pages; 163extern unsigned long totalreserve_pages;
@@ -230,9 +227,12 @@ extern int move_from_swap_cache(struct page *, unsigned long,
230 struct address_space *); 227 struct address_space *);
231extern void free_page_and_swap_cache(struct page *); 228extern void free_page_and_swap_cache(struct page *);
232extern void free_pages_and_swap_cache(struct page **, int); 229extern void free_pages_and_swap_cache(struct page **, int);
233extern struct page * lookup_swap_cache(swp_entry_t); 230extern struct page *lookup_swap_cache(swp_entry_t);
234extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma, 231extern struct page *read_swap_cache_async(swp_entry_t,
235 unsigned long addr); 232 struct vm_area_struct *vma, unsigned long addr);
233extern struct page *swapin_readahead(swp_entry_t,
234 struct vm_area_struct *vma, unsigned long addr);
235
236/* linux/mm/swapfile.c */ 236/* linux/mm/swapfile.c */
237extern long total_swap_pages; 237extern long total_swap_pages;
238extern unsigned int nr_swapfiles; 238extern unsigned int nr_swapfiles;
@@ -306,7 +306,7 @@ static inline void swap_free(swp_entry_t swp)
306{ 306{
307} 307}
308 308
309static inline struct page *read_swap_cache_async(swp_entry_t swp, 309static inline struct page *swapin_readahead(swp_entry_t swp,
310 struct vm_area_struct *vma, unsigned long addr) 310 struct vm_area_struct *vma, unsigned long addr)
311{ 311{
312 return NULL; 312 return NULL;
@@ -317,11 +317,6 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp)
317 return NULL; 317 return NULL;
318} 318}
319 319
320static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset)
321{
322 return 0;
323}
324
325#define can_share_swap_page(p) (page_mapcount(p) == 1) 320#define can_share_swap_page(p) (page_mapcount(p) == 1)
326 321
327static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) 322static inline int move_to_swap_cache(struct page *page, swp_entry_t entry)