Commit 9bc3e869 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

filemap: Move 'filler' case to the end of do_read_cache_folio()



No functionality change intended; this simply moves code around to
disentangle the function a little.

Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent 0e8e08cc
Loading
Loading
Loading
Loading
+13 −15
Original line number Diff line number Diff line
@@ -3492,20 +3492,7 @@ static struct folio *do_read_cache_folio(struct address_space *mapping,
			return ERR_PTR(err);
		}

filler:
		err = filler(file, folio);
		if (err < 0) {
			folio_put(folio);
			return ERR_PTR(err);
		}

		folio_wait_locked(folio);
		if (!folio_test_uptodate(folio)) {
			folio_put(folio);
			return ERR_PTR(-EIO);
		}

		goto out;
		goto filler;
	}
	if (folio_test_uptodate(folio))
		goto out;
@@ -3535,7 +3522,18 @@ static struct folio *do_read_cache_folio(struct address_space *mapping,
	 * set again if read page fails.
	 */
	folio_clear_error(folio);
	goto filler;
filler:
	err = filler(file, folio);
	if (err < 0) {
		folio_put(folio);
		return ERR_PTR(err);
	}

	folio_wait_locked(folio);
	if (!folio_test_uptodate(folio)) {
		folio_put(folio);
		return ERR_PTR(-EIO);
	}

out:
	folio_mark_accessed(folio);