Skip to content

Commit 93dfe2a

Browse files
author
Jaegeuk Kim
committed
f2fs: refactor bio-related operations
This patch integrates redundant bio operations on read and write IOs. 1. Move bio-related codes to the top of data.c. 2. Replace f2fs_submit_bio with f2fs_submit_merged_bio, which handles read bios additionally. 3. Introduce __submit_merged_bio to submit the merged bio. 4. Change f2fs_readpage to f2fs_submit_page_bio. 5. Introduce f2fs_submit_page_mbio to integrate previous submit_read_page and submit_write_page. Reviewed-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Reviewed-by: Chao Yu <chao2.yu@samsung.com > Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
1 parent 187b5b8 commit 93dfe2a

8 files changed

Lines changed: 257 additions & 299 deletions

File tree

‎fs/f2fs/checkpoint.c‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ struct page *get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index)
6161
if (PageUptodate(page))
6262
goto out;
6363

64-
if (f2fs_readpage(sbi, page, index, READ_SYNC | REQ_META | REQ_PRIO))
64+
if (f2fs_submit_page_bio(sbi, page, index,
65+
READ_SYNC | REQ_META | REQ_PRIO))
6566
goto repeat;
6667

6768
lock_page(page);
@@ -157,7 +158,8 @@ long sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
157158
}
158159

159160
if (nwritten)
160-
f2fs_submit_bio(sbi, type, nr_to_write == LONG_MAX);
161+
f2fs_submit_merged_bio(sbi, type, nr_to_write == LONG_MAX,
162+
WRITE);
161163

162164
return nwritten;
163165
}
@@ -590,7 +592,7 @@ void sync_dirty_dir_inodes(struct f2fs_sb_info *sbi)
590592
* We should submit bio, since it exists several
591593
* wribacking dentry pages in the freeing inode.
592594
*/
593-
f2fs_submit_bio(sbi, DATA, true);
595+
f2fs_submit_merged_bio(sbi, DATA, true, WRITE);
594596
}
595597
goto retry;
596598
}
@@ -796,9 +798,9 @@ void write_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
796798

797799
trace_f2fs_write_checkpoint(sbi->sb, is_umount, "finish block_ops");
798800

799-
f2fs_submit_bio(sbi, DATA, true);
800-
f2fs_submit_bio(sbi, NODE, true);
801-
f2fs_submit_bio(sbi, META, true);
801+
f2fs_submit_merged_bio(sbi, DATA, true, WRITE);
802+
f2fs_submit_merged_bio(sbi, NODE, true, WRITE);
803+
f2fs_submit_merged_bio(sbi, META, true, WRITE);
802804

803805
/*
804806
* update checkpoint pack index

0 commit comments

Comments
 (0)