aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2008-02-05 01:28:50 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:15 -0500
commit73b1262fa43a778b1e154deea632cdef5009d6a1 (patch)
tree409f14e78e23cd999e8c3d1e0945f0fa9b67048f /include/linux/swap.h
parentf000944d03a5b74ab3c92b2fcdf0e944cc898065 (diff)
tmpfs: move swap swizzling into shmem
move_to_swap_cache and move_from_swap_cache functions (which swizzle a page between tmpfs page cache and swap cache, to avoid page copying) are only used by shmem.c; and our subsequent fix for unionfs needs different treatments in the two instances of move_from_swap_cache. Move them from swap_state.c into their callsites shmem_writepage, shmem_unuse_inode and shmem_getpage, making add_to_swap_cache externally visible. shmem.c likes to say set_page_dirty where swap_state.c liked to say SetPageDirty: respect that diversity, which __set_page_dirty_no_writeback makes moot (and implies we should lose that "shift page from clean_pages to dirty_pages list" comment: it's on neither). Signed-off-by: Hugh Dickins <hugh@veritas.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.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 16fd1209e9fa..353153ea0bd5 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -220,11 +220,9 @@ extern struct address_space swapper_space;
220#define total_swapcache_pages swapper_space.nrpages 220#define total_swapcache_pages swapper_space.nrpages
221extern void show_swap_cache_info(void); 221extern void show_swap_cache_info(void);
222extern int add_to_swap(struct page *, gfp_t); 222extern int add_to_swap(struct page *, gfp_t);
223extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t);
223extern void __delete_from_swap_cache(struct page *); 224extern void __delete_from_swap_cache(struct page *);
224extern void delete_from_swap_cache(struct page *); 225extern void delete_from_swap_cache(struct page *);
225extern int move_to_swap_cache(struct page *, swp_entry_t);
226extern int move_from_swap_cache(struct page *, unsigned long,
227 struct address_space *);
228extern void free_page_and_swap_cache(struct page *); 226extern void free_page_and_swap_cache(struct page *);
229extern void free_pages_and_swap_cache(struct page **, int); 227extern void free_pages_and_swap_cache(struct page **, int);
230extern struct page *lookup_swap_cache(swp_entry_t); 228extern struct page *lookup_swap_cache(swp_entry_t);
@@ -319,15 +317,10 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp)
319 317
320#define can_share_swap_page(p) (page_mapcount(p) == 1) 318#define can_share_swap_page(p) (page_mapcount(p) == 1)
321 319
322static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) 320static inline int add_to_swap_cache(struct page *page, swp_entry_t entry,
321 gfp_t gfp_mask)
323{ 322{
324 return 1; 323 return -1;
325}
326
327static inline int move_from_swap_cache(struct page *page, unsigned long index,
328 struct address_space *mapping)
329{
330 return 1;
331} 324}
332 325
333static inline void __delete_from_swap_cache(struct page *page) 326static inline void __delete_from_swap_cache(struct page *page)