f2fs: use folio_test_writeback
Let's convert PageWriteback to folio_test_writeback. Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
fa18d87cb2
commit
16778aea91
@ -1484,7 +1484,7 @@ continue_unlock:
|
||||
if (!PageDirty(cc->rpages[i]))
|
||||
goto continue_unlock;
|
||||
|
||||
if (PageWriteback(cc->rpages[i])) {
|
||||
if (folio_test_writeback(page_folio(cc->rpages[i]))) {
|
||||
if (wbc->sync_mode == WB_SYNC_NONE)
|
||||
goto continue_unlock;
|
||||
f2fs_wait_on_page_writeback(cc->rpages[i], DATA, true, true);
|
||||
|
@ -2704,8 +2704,7 @@ got_it:
|
||||
if (err) {
|
||||
if (fscrypt_inode_uses_fs_layer_crypto(inode))
|
||||
fscrypt_finalize_bounce_page(&fio->encrypted_page);
|
||||
if (PageWriteback(page))
|
||||
end_page_writeback(page);
|
||||
end_page_writeback(page);
|
||||
} else {
|
||||
set_inode_flag(inode, FI_UPDATE_WRITE);
|
||||
}
|
||||
|
@ -4660,7 +4660,7 @@ static inline void f2fs_truncate_meta_inode_pages(struct f2fs_sb_info *sbi,
|
||||
|
||||
page = find_get_page(META_MAPPING(sbi), blkaddr + i);
|
||||
if (page) {
|
||||
if (PageWriteback(page))
|
||||
if (folio_test_writeback(page_folio(page)))
|
||||
need_submit = true;
|
||||
f2fs_put_page(page, 0);
|
||||
}
|
||||
|
@ -1434,7 +1434,7 @@ static int move_data_page(struct inode *inode, block_t bidx, int gc_type,
|
||||
goto out;
|
||||
|
||||
if (gc_type == BG_GC) {
|
||||
if (PageWriteback(page)) {
|
||||
if (folio_test_writeback(page_folio(page))) {
|
||||
err = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
f2fs_bug_on(F2FS_P_SB(page), PageWriteback(page));
|
||||
f2fs_bug_on(F2FS_P_SB(page), folio_test_writeback(page_folio(page)));
|
||||
|
||||
f2fs_do_read_inline_data(page, dn->inode_page);
|
||||
set_page_dirty(page);
|
||||
|
@ -161,7 +161,8 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page)
|
||||
if (!f2fs_enable_inode_chksum(sbi, page))
|
||||
#else
|
||||
if (!f2fs_enable_inode_chksum(sbi, page) ||
|
||||
PageDirty(page) || PageWriteback(page))
|
||||
PageDirty(page) ||
|
||||
folio_test_writeback(page_folio(page)))
|
||||
#endif
|
||||
return true;
|
||||
|
||||
|
@ -1743,7 +1743,7 @@ int f2fs_move_node_page(struct page *node_page, int gc_type)
|
||||
goto release_page;
|
||||
} else {
|
||||
/* set page dirty and write it */
|
||||
if (!PageWriteback(node_page))
|
||||
if (!folio_test_writeback(page_folio(node_page)))
|
||||
set_page_dirty(node_page);
|
||||
}
|
||||
out_page:
|
||||
|
@ -3614,13 +3614,13 @@ skip_new_segment:
|
||||
mutex_unlock(&curseg->curseg_mutex);
|
||||
f2fs_up_read(&SM_I(sbi)->curseg_lock);
|
||||
return 0;
|
||||
|
||||
out_err:
|
||||
*new_blkaddr = NULL_ADDR;
|
||||
up_write(&sit_i->sentry_lock);
|
||||
mutex_unlock(&curseg->curseg_mutex);
|
||||
f2fs_up_read(&SM_I(sbi)->curseg_lock);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
void f2fs_update_device_state(struct f2fs_sb_info *sbi, nid_t ino,
|
||||
@ -3662,8 +3662,7 @@ static void do_write_page(struct f2fs_summary *sum, struct f2fs_io_info *fio)
|
||||
&fio->new_blkaddr, sum, type, fio)) {
|
||||
if (fscrypt_inode_uses_fs_layer_crypto(fio->page->mapping->host))
|
||||
fscrypt_finalize_bounce_page(&fio->encrypted_page);
|
||||
if (PageWriteback(fio->page))
|
||||
end_page_writeback(fio->page);
|
||||
end_page_writeback(fio->page);
|
||||
if (f2fs_in_warm_node_list(fio->sbi, fio->page))
|
||||
f2fs_del_fsync_node_entry(fio->sbi, fio->page);
|
||||
goto out;
|
||||
@ -3906,7 +3905,7 @@ void f2fs_replace_block(struct f2fs_sb_info *sbi, struct dnode_of_data *dn,
|
||||
void f2fs_wait_on_page_writeback(struct page *page,
|
||||
enum page_type type, bool ordered, bool locked)
|
||||
{
|
||||
if (PageWriteback(page)) {
|
||||
if (folio_test_writeback(page_folio(page))) {
|
||||
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
|
||||
|
||||
/* submit cached LFS IO */
|
||||
@ -3915,7 +3914,8 @@ void f2fs_wait_on_page_writeback(struct page *page,
|
||||
f2fs_submit_merged_ipu_write(sbi, NULL, page);
|
||||
if (ordered) {
|
||||
wait_on_page_writeback(page);
|
||||
f2fs_bug_on(sbi, locked && PageWriteback(page));
|
||||
f2fs_bug_on(sbi, locked &&
|
||||
folio_test_writeback(page_folio(page)));
|
||||
} else {
|
||||
wait_for_stable_page(page);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user