]> 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>
Wed, 5 Apr 2023 23:02:15 +0000 (16:02 -0700)
commit950626d92c8b29118e4a7d6b9adb63be52ad5cb6
treedea2806bdbe1f77c28e98ad18d0ebf386e7dafb1
parenta8b37138a9a30a4b5d6e3756d82634f9e6ba687c
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