ext4: Convert ext4_page_nomap_can_writeout to ext4_folio_nomap_can_writeout

Its one caller already uses a folio.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20230324180129.1220691-22-willy@infradead.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Matthew Wilcox
2023-03-24 18:01:21 +00:00
committed by Theodore Ts'o
parent 9d3973de9a
commit 02e4b04c56

View File

@@ -2335,12 +2335,12 @@ static int ext4_da_writepages_trans_blocks(struct inode *inode)
MAX_WRITEPAGES_EXTENT_LEN + bpp - 1, bpp); MAX_WRITEPAGES_EXTENT_LEN + bpp - 1, bpp);
} }
/* Return true if the page needs to be written as part of transaction commit */ /* Return true if the folio needs to be written as part of transaction commit */
static bool ext4_page_nomap_can_writeout(struct page *page) static bool ext4_folio_nomap_can_writeout(struct folio *folio)
{ {
struct buffer_head *bh, *head; struct buffer_head *bh, *head;
bh = head = page_buffers(page); bh = head = folio_buffers(folio);
do { do {
if (buffer_dirty(bh) && buffer_mapped(bh) && !buffer_delay(bh)) if (buffer_dirty(bh) && buffer_mapped(bh) && !buffer_delay(bh))
return true; return true;
@@ -2533,7 +2533,7 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
* range operations before discarding the page cache. * range operations before discarding the page cache.
*/ */
if (!mpd->can_map) { if (!mpd->can_map) {
if (ext4_page_nomap_can_writeout(&folio->page)) { if (ext4_folio_nomap_can_writeout(folio)) {
WARN_ON_ONCE(sb->s_writers.frozen == WARN_ON_ONCE(sb->s_writers.frozen ==
SB_FREEZE_COMPLETE); SB_FREEZE_COMPLETE);
err = mpage_submit_folio(mpd, folio); err = mpage_submit_folio(mpd, folio);