ext4: Convert to release_folio

The use of folios should be pushed deeper into ext4 from here.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
This commit is contained in:
Matthew Wilcox (Oracle) 2022-04-30 23:33:38 -04:00
parent 8c5de05e41
commit 3c402f1543

View File

@ -3243,19 +3243,19 @@ static void ext4_journalled_invalidate_folio(struct folio *folio,
WARN_ON(__ext4_journalled_invalidate_folio(folio, offset, length) < 0);
}
static int ext4_releasepage(struct page *page, gfp_t wait)
static bool ext4_release_folio(struct folio *folio, gfp_t wait)
{
journal_t *journal = EXT4_JOURNAL(page->mapping->host);
journal_t *journal = EXT4_JOURNAL(folio->mapping->host);
trace_ext4_releasepage(page);
trace_ext4_releasepage(&folio->page);
/* Page has dirty journalled data -> cannot release */
if (PageChecked(page))
return 0;
if (folio_test_checked(folio))
return false;
if (journal)
return jbd2_journal_try_to_free_buffers(journal, page);
return jbd2_journal_try_to_free_buffers(journal, &folio->page);
else
return try_to_free_buffers(page);
return try_to_free_buffers(&folio->page);
}
static bool ext4_inode_datasync_dirty(struct inode *inode)
@ -3618,7 +3618,7 @@ static const struct address_space_operations ext4_aops = {
.dirty_folio = ext4_dirty_folio,
.bmap = ext4_bmap,
.invalidate_folio = ext4_invalidate_folio,
.releasepage = ext4_releasepage,
.release_folio = ext4_release_folio,
.direct_IO = noop_direct_IO,
.migratepage = buffer_migrate_page,
.is_partially_uptodate = block_is_partially_uptodate,
@ -3636,7 +3636,7 @@ static const struct address_space_operations ext4_journalled_aops = {
.dirty_folio = ext4_journalled_dirty_folio,
.bmap = ext4_bmap,
.invalidate_folio = ext4_journalled_invalidate_folio,
.releasepage = ext4_releasepage,
.release_folio = ext4_release_folio,
.direct_IO = noop_direct_IO,
.is_partially_uptodate = block_is_partially_uptodate,
.error_remove_page = generic_error_remove_page,
@ -3653,7 +3653,7 @@ static const struct address_space_operations ext4_da_aops = {
.dirty_folio = ext4_dirty_folio,
.bmap = ext4_bmap,
.invalidate_folio = ext4_invalidate_folio,
.releasepage = ext4_releasepage,
.release_folio = ext4_release_folio,
.direct_IO = noop_direct_IO,
.migratepage = buffer_migrate_page,
.is_partially_uptodate = block_is_partially_uptodate,