diff options
author | D. Andrei Măceș <dmaces@nd.edu> | 2015-09-30 15:18:37 -0400 |
---|---|---|
committer | Simon Shields <keepcalm444@gmail.com> | 2016-06-12 21:20:18 +1000 |
commit | 4698b1b9e737365e206f1ef55a864d8e205fe8f3 (patch) | |
tree | f842b37023d7cfb21ea9b0f269ff2cbae5d40591 /mm | |
parent | a6ce37fb73dce407da9d7d1d03408602be84177c (diff) | |
download | kernel_samsung_smdk4412-4698b1b9e737365e206f1ef55a864d8e205fe8f3.zip kernel_samsung_smdk4412-4698b1b9e737365e206f1ef55a864d8e205fe8f3.tar.gz kernel_samsung_smdk4412-4698b1b9e737365e206f1ef55a864d8e205fe8f3.tar.bz2 |
mm: Need page_swap_info() helper method from upstream
Stolen from commit f981c5950fa85916ba49bea5d9a7a5078f47e569:
"mm: methods for teaching filesystems about PG_swapcache pages"
Change-Id: I6673913f9c825d3a6de88a652e99bcaf04eb1dd6
Diffstat (limited to 'mm')
-rw-r--r-- | mm/swapfile.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 7197864..4add436 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2321,6 +2321,13 @@ int swapcache_prepare(swp_entry_t entry) return __swap_duplicate(entry, SWAP_HAS_CACHE); } +struct swap_info_struct *page_swap_info(struct page *page) +{ + swp_entry_t swap = { .val = page_private(page) }; + BUG_ON(!PageSwapCache(page)); + return swap_info[swp_type(swap)]; +} + /* * swap_lock prevents swap_map being freed. Don't grab an extra * reference on the swaphandle, it doesn't matter if it becomes unused. |