ext2: Use a folio in ext2_get_page()

Remove a call to read_mapping_page().
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent 24015907
......@@ -200,18 +200,19 @@ static struct page * ext2_get_page(struct inode *dir, unsigned long n,
int quiet, void **page_addr)
{
struct address_space *mapping = dir->i_mapping;
struct page *page = read_mapping_page(mapping, n, NULL);
if (!IS_ERR(page)) {
*page_addr = kmap_local_page(page);
if (unlikely(!PageChecked(page))) {
if (!ext2_check_page(page, quiet, *page_addr))
struct folio *folio = read_mapping_folio(mapping, n, NULL);
if (IS_ERR(folio))
return &folio->page;
*page_addr = kmap_local_folio(folio, n & (folio_nr_pages(folio) - 1));
if (unlikely(!folio_test_checked(folio))) {
if (!ext2_check_page(&folio->page, quiet, *page_addr))
goto fail;
}
}
return page;
return &folio->page;
fail:
ext2_put_page(page, *page_addr);
ext2_put_page(&folio->page, *page_addr);
return ERR_PTR(-EIO);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment