iomap/gfs2: Get page in page_prepare handler
authorAndreas Gruenbacher <agruenba@redhat.com>
Sun, 15 Jan 2023 16:49:12 +0000 (08:49 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 18 Jan 2023 18:44:04 +0000 (10:44 -0800)
commit9060bc4d3aca6106bbe72891efba391d9d6b86e7
tree8a7aa607ea3a76139022448beb015edfbeb360f9
parent98321b5139f92a736a426404fb6e23bfb8feb9cc
iomap/gfs2: Get page in page_prepare handler

Change the iomap ->page_prepare() handler to get and return a locked
folio instead of doing that in iomap_write_begin().  This allows to
recover from out-of-memory situations in ->page_prepare(), which
eliminates the corresponding error handling code in iomap_write_begin().
The ->put_folio() handler now also isn't called with NULL as the folio
value anymore.

Filesystems are expected to use the iomap_get_folio() helper for getting
locked folios in their ->page_prepare() handlers.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/gfs2/bmap.c
fs/iomap/buffered-io.c
include/linux/iomap.h