@@ -325,16 +325,16 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index,
unsigned int ra_blocks)
{
- struct page *page;
+ struct folio *folio;
bool readahead = false;
if (ra_blocks == RECOVERY_MIN_RA_BLOCKS)
return;
- page = find_get_page(META_MAPPING(sbi), index);
- if (!page || !PageUptodate(page))
+ folio = filemap_get_folio(META_MAPPING(sbi), index);
+ if (IS_ERR(folio) || !folio_test_uptodate(folio))
readahead = true;
- f2fs_put_page(page, 0);
+ f2fs_folio_put(folio, 0);
if (readahead)
f2fs_ra_meta_pages(sbi, index, ra_blocks, META_POR, true);
@@ -2871,7 +2871,7 @@ static inline struct page *f2fs_pagecache_get_page(
static inline void f2fs_folio_put(struct folio *folio, bool unlock)
{
- if (!folio)
+ if (IS_ERR_OR_NULL(folio))
return;
if (unlock) {
Remove a call to find_get_page(). Saves two hidden calls to compound_head(). Change f2fs_folio_put() to check for IS_ERR_OR_NULL to handle the case where we got an error pointer back from filemap_get_folio(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- fs/f2fs/checkpoint.c | 8 ++++---- fs/f2fs/f2fs.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)