Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2019-02-22 12:04:11 +0000
committerMel Gorman <mgorman@suse.de>2019-02-22 12:49:38 +0000
commit3d51d2b828321216499f0d9843bcf7109eee26ba (patch)
tree47255f0ac5f74bc0b2d503fdda3e6a3001c212fd
parentffc8e80896e8c572e453bb92ad4494abf0855158 (diff)
mm: use swp_offset as key in shmem_replace_page() (git fixes
(mm/shmem)). suse-commit: 44fe0626006cf7b62cb963a3d788ecaa8b8085d3
-rw-r--r--mm/shmem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 3f5af65d76bc..e5a01786f187 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1530,11 +1530,13 @@ static int shmem_replace_page(struct page **pagep, gfp_t gfp,
{
struct page *oldpage, *newpage;
struct address_space *swap_mapping;
+ swp_entry_t entry;
pgoff_t swap_index;
int error;
oldpage = *pagep;
- swap_index = page_private(oldpage);
+ entry.val = page_private(oldpage);
+ swap_index = swp_offset(entry);
swap_mapping = page_mapping(oldpage);
/*
@@ -1553,7 +1555,7 @@ static int shmem_replace_page(struct page **pagep, gfp_t gfp,
__SetPageLocked(newpage);
__SetPageSwapBacked(newpage);
SetPageUptodate(newpage);
- set_page_private(newpage, swap_index);
+ set_page_private(newpage, entry.val);
SetPageSwapCache(newpage);
/*