filemap: Allow __filemap_get_folio to allocate large folios
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 19 May 2023 20:10:37 +0000 (16:10 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 24 Jul 2023 22:04:30 +0000 (18:04 -0400)
commit4f66170119107f1452d2438ba4606e105e9e3afe
treea73e91753ba11b83ac123911a3e89df18b4f1d6f
parentffc143db63eeea7c8a27deb3c56d090a220a1ace
filemap: Allow __filemap_get_folio to allocate large folios

Allow callers of __filemap_get_folio() to specify a preferred folio
order in the FGP flags.  This is only honoured in the FGP_CREATE path;
if there is already a folio in the page cache that covers the index,
we will return it, no matter what its order is.  No create-around is
attempted; we will only create folios which start at the specified index.
Unmodified callers will continue to allocate order 0 folios.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
include/linux/pagemap.h
mm/filemap.c
mm/readahead.c