diff --git a/mm/shmem.c b/mm/shmem.c index cd6b4bc221ebc4e02bc74c0ed0758a569482658a..0b02b539072e391b9eec57adbba4df6d3abf6d29 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1551,11 +1551,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); /* @@ -1574,7 +1576,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); /*