]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: simplify error return logic when getting folio at prepare_one_folio()
authorFilipe Manana <fdmanana@suse.com>
Sat, 10 May 2025 13:08:39 +0000 (14:08 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:57 +0000 (14:30 +0200)
commit0f2bc221507fa1e787b87c783f4c699e5feb8957
tree1dc58f8d61d44432412def5dcb723519cb7a482b
parent443e4d0e1c622885cb3d048619b4cc2c27a812bd
btrfs: simplify error return logic when getting folio at prepare_one_folio()

There's no need to have special logic to return -EAGAIN in case the call
to __filemap_get_folio() fails, because when FGP_NOWAIT is passed to
__filemap_get_folio() it returns ERR_PTR(-EAGAIN) if it needs to do
something that would imply blocking.

The reason we have this logic is from the days before we migrated to the
folio interface, when we called pagecache_get_page() which would return
NULL instead of an error pointer.

So remove this special casing and always return the error that the call
to __filemap_get_folio() returned.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c