summaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-02-26 02:15:36 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2021-02-26 18:40:59 +0100
commit44835d20b2a0c9b4c0c3fb96e90f4e2fd4a4e41d (patch)
tree011ba8a7a9d39340481b07edebe67a363412eae1 /mm/shmem.c
parentmm/swap: optimise get_shadow_from_swap_cache (diff)
downloadlinux-44835d20b2a0c9b4c0c3fb96e90f4e2fd4a4e41d.tar.xz
linux-44835d20b2a0c9b4c0c3fb96e90f4e2fd4a4e41d.zip
mm: add FGP_ENTRY
The functionality of find_lock_entry() and find_get_entry() can be provided by pagecache_get_page(), which lets us delete find_lock_entry() and make find_get_entry() static. Link: https://lkml.kernel.org/r/20201112212641.27837-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Dave Chinner <dchinner@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jan Kara <jack@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: William Kucharski <william.kucharski@oracle.com> Cc: Yang Shi <yang.shi@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 5ea1fa53db3f..bd5bb78128af 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1812,7 +1812,8 @@ repeat:
sbinfo = SHMEM_SB(inode->i_sb);
charge_mm = vma ? vma->vm_mm : current->mm;
- page = find_lock_entry(mapping, index);
+ page = pagecache_get_page(mapping, index,
+ FGP_ENTRY | FGP_HEAD | FGP_LOCK, 0);
if (xa_is_value(page)) {
error = shmem_swapin_page(inode, index, &page,
sgp, gfp, vma, fault_type);