提交 07950008 编写于 作者: M Matthew Wilcox (Oracle)

mm/filemap: Hoist filler_t decision to the top of do_read_cache_folio()

Now that filler_t and aops->read_folio() have the same type, we can decide
which one to use at the top of the function, and cache ->read_folio in
the filler parameter.
Signed-off-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
上级 e9b5b23e
......@@ -3487,6 +3487,9 @@ static struct folio *do_read_cache_folio(struct address_space *mapping,
{
struct folio *folio;
int err;
if (!filler)
filler = mapping->a_ops->read_folio;
repeat:
folio = filemap_get_folio(mapping, index);
if (!folio) {
......@@ -3503,11 +3506,7 @@ static struct folio *do_read_cache_folio(struct address_space *mapping,
}
filler:
if (filler)
err = filler(file, folio);
else
err = mapping->a_ops->read_folio(file, folio);
err = filler(file, folio);
if (err < 0) {
folio_put(folio);
return ERR_PTR(err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册