diff options
author | Seth Jennings <sjenning@linux.vnet.ibm.com> | 2013-04-29 18:08:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:38 -0400 |
commit | 2f772e6cadf8ad8fca38927b17e6be028be669f5 (patch) | |
tree | 5eac4cfd72c6e8e9b4d48ad7463cdf1a8b97f7b4 /include | |
parent | e8420a8ece80b3fe810415ecf061d54ca7fab266 (diff) |
mm: break up swap_writepage() for frontswap backends
swap_writepage() is currently where frontswap hooks into the swap write
path to capture pages with the frontswap_store() function. However, if
a frontswap backend wants to "resume" the writeback of a page to the
swap device, it can't call swap_writepage() as the page will simply
reenter the backend.
This patch separates swap_writepage() into a top and bottom half, the
bottom half named __swap_writepage() to allow a frontswap backend, like
zswap, to resume writeback beyond the frontswap_store() hook.
__add_to_swap_cache() is also made non-static so that the page for which
writeback is to be resumed can be added to the swap cache.
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/swap.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 2818a123f3ea..76f6c3b31235 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -330,6 +330,7 @@ static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) | |||
330 | /* linux/mm/page_io.c */ | 330 | /* linux/mm/page_io.c */ |
331 | extern int swap_readpage(struct page *); | 331 | extern int swap_readpage(struct page *); |
332 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); | 332 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); |
333 | extern int __swap_writepage(struct page *page, struct writeback_control *wbc); | ||
333 | extern int swap_set_page_dirty(struct page *page); | 334 | extern int swap_set_page_dirty(struct page *page); |
334 | extern void end_swap_bio_read(struct bio *bio, int err); | 335 | extern void end_swap_bio_read(struct bio *bio, int err); |
335 | 336 | ||
@@ -345,6 +346,7 @@ extern unsigned long total_swapcache_pages(void); | |||
345 | extern void show_swap_cache_info(void); | 346 | extern void show_swap_cache_info(void); |
346 | extern int add_to_swap(struct page *); | 347 | extern int add_to_swap(struct page *); |
347 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | 348 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); |
349 | extern int __add_to_swap_cache(struct page *page, swp_entry_t entry); | ||
348 | extern void __delete_from_swap_cache(struct page *); | 350 | extern void __delete_from_swap_cache(struct page *); |
349 | extern void delete_from_swap_cache(struct page *); | 351 | extern void delete_from_swap_cache(struct page *); |
350 | extern void free_page_and_swap_cache(struct page *); | 352 | extern void free_page_and_swap_cache(struct page *); |