Skip to content

Commit 16778ae

Browse files
author
Jaegeuk Kim
committed
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>
1 parent fa18d87 commit 16778ae

8 files changed

Lines changed: 13 additions & 13 deletions

File tree

fs/f2fs/compress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ static int f2fs_write_raw_pages(struct compress_ctx *cc,
14841484
if (!PageDirty(cc->rpages[i]))
14851485
goto continue_unlock;
14861486

1487-
if (PageWriteback(cc->rpages[i])) {
1487+
if (folio_test_writeback(page_folio(cc->rpages[i]))) {
14881488
if (wbc->sync_mode == WB_SYNC_NONE)
14891489
goto continue_unlock;
14901490
f2fs_wait_on_page_writeback(cc->rpages[i], DATA, true, true);

fs/f2fs/data.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,8 +2704,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
27042704
if (err) {
27052705
if (fscrypt_inode_uses_fs_layer_crypto(inode))
27062706
fscrypt_finalize_bounce_page(&fio->encrypted_page);
2707-
if (PageWriteback(page))
2708-
end_page_writeback(page);
2707+
end_page_writeback(page);
27092708
} else {
27102709
set_inode_flag(inode, FI_UPDATE_WRITE);
27112710
}

fs/f2fs/f2fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4660,7 +4660,7 @@ static inline void f2fs_truncate_meta_inode_pages(struct f2fs_sb_info *sbi,
46604660

46614661
page = find_get_page(META_MAPPING(sbi), blkaddr + i);
46624662
if (page) {
4663-
if (PageWriteback(page))
4663+
if (folio_test_writeback(page_folio(page)))
46644664
need_submit = true;
46654665
f2fs_put_page(page, 0);
46664666
}

fs/f2fs/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ static int move_data_page(struct inode *inode, block_t bidx, int gc_type,
14341434
goto out;
14351435

14361436
if (gc_type == BG_GC) {
1437-
if (PageWriteback(page)) {
1437+
if (folio_test_writeback(page_folio(page))) {
14381438
err = -EAGAIN;
14391439
goto out;
14401440
}

fs/f2fs/inline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
164164
return -EFSCORRUPTED;
165165
}
166166

167-
f2fs_bug_on(F2FS_P_SB(page), PageWriteback(page));
167+
f2fs_bug_on(F2FS_P_SB(page), folio_test_writeback(page_folio(page)));
168168

169169
f2fs_do_read_inline_data(page, dn->inode_page);
170170
set_page_dirty(page);

fs/f2fs/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page)
161161
if (!f2fs_enable_inode_chksum(sbi, page))
162162
#else
163163
if (!f2fs_enable_inode_chksum(sbi, page) ||
164-
PageDirty(page) || PageWriteback(page))
164+
PageDirty(page) ||
165+
folio_test_writeback(page_folio(page)))
165166
#endif
166167
return true;
167168

fs/f2fs/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ int f2fs_move_node_page(struct page *node_page, int gc_type)
17431743
goto release_page;
17441744
} else {
17451745
/* set page dirty and write it */
1746-
if (!PageWriteback(node_page))
1746+
if (!folio_test_writeback(page_folio(node_page)))
17471747
set_page_dirty(node_page);
17481748
}
17491749
out_page:

fs/f2fs/segment.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,13 +3614,13 @@ int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
36143614
mutex_unlock(&curseg->curseg_mutex);
36153615
f2fs_up_read(&SM_I(sbi)->curseg_lock);
36163616
return 0;
3617+
36173618
out_err:
36183619
*new_blkaddr = NULL_ADDR;
36193620
up_write(&sit_i->sentry_lock);
36203621
mutex_unlock(&curseg->curseg_mutex);
36213622
f2fs_up_read(&SM_I(sbi)->curseg_lock);
36223623
return ret;
3623-
36243624
}
36253625

36263626
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)
36623662
&fio->new_blkaddr, sum, type, fio)) {
36633663
if (fscrypt_inode_uses_fs_layer_crypto(fio->page->mapping->host))
36643664
fscrypt_finalize_bounce_page(&fio->encrypted_page);
3665-
if (PageWriteback(fio->page))
3666-
end_page_writeback(fio->page);
3665+
end_page_writeback(fio->page);
36673666
if (f2fs_in_warm_node_list(fio->sbi, fio->page))
36683667
f2fs_del_fsync_node_entry(fio->sbi, fio->page);
36693668
goto out;
@@ -3906,7 +3905,7 @@ void f2fs_replace_block(struct f2fs_sb_info *sbi, struct dnode_of_data *dn,
39063905
void f2fs_wait_on_page_writeback(struct page *page,
39073906
enum page_type type, bool ordered, bool locked)
39083907
{
3909-
if (PageWriteback(page)) {
3908+
if (folio_test_writeback(page_folio(page))) {
39103909
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
39113910

39123911
/* submit cached LFS IO */
@@ -3915,7 +3914,8 @@ void f2fs_wait_on_page_writeback(struct page *page,
39153914
f2fs_submit_merged_ipu_write(sbi, NULL, page);
39163915
if (ordered) {
39173916
wait_on_page_writeback(page);
3918-
f2fs_bug_on(sbi, locked && PageWriteback(page));
3917+
f2fs_bug_on(sbi, locked &&
3918+
folio_test_writeback(page_folio(page)));
39193919
} else {
39203920
wait_for_stable_page(page);
39213921
}

0 commit comments

Comments
 (0)