]> www.infradead.org Git - users/jedix/linux-maple.git/commit
shmem: open code the page cache lookup in shmem_get_folio_gfp
authorChristoph Hellwig <hch@lst.de>
Tue, 7 Mar 2023 14:34:08 +0000 (15:34 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 28 Mar 2023 23:24:58 +0000 (16:24 -0700)
commit968b9e2a03e39bcd598bc8fd3bb6b600f6b7a127
tree00cd0c3c5ec46513bfd61d784a55ecbf9fe5f2dd
parente1166eca8d8636d38f75a786a3f05a22bfe75ff5
shmem: open code the page cache lookup in shmem_get_folio_gfp

Use the very low level filemap_get_entry helper to look up the entry in
the xarray, and then:

 - don't bother locking the folio if only doing a userfault notification
 - open code locking the page and checking for truncation in a related
   code block

This will allow to eventually remove the FGP_ENTRY flag.

Link: https://lkml.kernel.org/r/20230307143410.28031-6-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/shmem.c