Merge tag 'locking-urgent-2021-04-11' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / mm / swap_state.c
index c1a648d..3cdee7b 100644 (file)
@@ -87,11 +87,9 @@ void *get_shadow_from_swap_cache(swp_entry_t entry)
        pgoff_t idx = swp_offset(entry);
        struct page *page;
 
-       page = find_get_entry(address_space, idx);
+       page = xa_load(&address_space->i_pages, idx);
        if (xa_is_value(page))
                return page;
-       if (page)
-               put_page(page);
        return NULL;
 }
 
@@ -405,7 +403,8 @@ struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index)
 {
        swp_entry_t swp;
        struct swap_info_struct *si;
-       struct page *page = find_get_entry(mapping, index);
+       struct page *page = pagecache_get_page(mapping, index,
+                                               FGP_ENTRY | FGP_HEAD, 0);
 
        if (!page)
                return page;