diff options
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 312fafe0ab6e..3187079903fd 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -510,6 +510,16 @@ void swap_free(swp_entry_t entry) | |||
510 | } | 510 | } |
511 | 511 | ||
512 | /* | 512 | /* |
513 | * Called after dropping swapcache to decrease refcnt to swap entries. | ||
514 | */ | ||
515 | void swapcache_free(swp_entry_t entry, struct page *page) | ||
516 | { | ||
517 | if (page) | ||
518 | mem_cgroup_uncharge_swapcache(page, entry); | ||
519 | return swap_free(entry); | ||
520 | } | ||
521 | |||
522 | /* | ||
513 | * How many references to page are currently swapped out? | 523 | * How many references to page are currently swapped out? |
514 | */ | 524 | */ |
515 | static inline int page_swapcount(struct page *page) | 525 | static inline int page_swapcount(struct page *page) |
@@ -1979,6 +1989,15 @@ bad_file: | |||
1979 | goto out; | 1989 | goto out; |
1980 | } | 1990 | } |
1981 | 1991 | ||
1992 | /* | ||
1993 | * Called when allocating swap cache for exising swap entry, | ||
1994 | */ | ||
1995 | int swapcache_prepare(swp_entry_t entry) | ||
1996 | { | ||
1997 | return swap_duplicate(entry); | ||
1998 | } | ||
1999 | |||
2000 | |||
1982 | struct swap_info_struct * | 2001 | struct swap_info_struct * |
1983 | get_swap_info_struct(unsigned type) | 2002 | get_swap_info_struct(unsigned type) |
1984 | { | 2003 | { |