diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-11 05:54:01 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-23 02:18:06 +0100 |
commit | 458e6197c37de53f7be0a837644daabb900c3036 (patch) | |
tree | 248c02467c0c1f8d84a8e6c23700620a939f3c58 /fs/f2fs/gc.c | |
parent | f2fs: merge pages with the same sync_mode flag (diff) | |
download | linux-458e6197c37de53f7be0a837644daabb900c3036.tar.xz linux-458e6197c37de53f7be0a837644daabb900c3036.zip |
f2fs: refactor bio->rw handling
This patch introduces f2fs_io_info to mitigate the complex parameter list.
struct f2fs_io_info {
enum page_type type; /* contains DATA/NODE/META/META_FLUSH */
int rw; /* contains R/RS/W/WS */
int rw_flag; /* contains REQ_META/REQ_PRIO */
}
1. f2fs_write_data_pages
- DATA
- WRITE_SYNC is set when wbc->WB_SYNC_ALL.
2. sync_node_pages
- NODE
- WRITE_SYNC all the time
3. sync_meta_pages
- META
- WRITE_SYNC all the time
- REQ_META | REQ_PRIO all the time
** f2fs_submit_merged_bio() handles META_FLUSH.
4. ra_nat_pages, ra_sit_pages, ra_sum_pages
- META
- READ_SYNC
Cc: Fan Li <fanofcode.li@samsung.com>
Cc: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index c68fba5ffadb..69c18e399014 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -520,8 +520,10 @@ static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, static void move_data_page(struct inode *inode, struct page *page, int gc_type) { - struct writeback_control wbc = { - .sync_mode = 1, + struct f2fs_io_info fio = { + .type = DATA, + .rw = WRITE_SYNC, + .rw_flag = 0, }; if (gc_type == BG_GC) { @@ -540,7 +542,7 @@ static void move_data_page(struct inode *inode, struct page *page, int gc_type) inode_dec_dirty_dents(inode); } set_cold_data(page); - do_write_data_page(page, &wbc); + do_write_data_page(page, &fio); clear_cold_data(page); } out: @@ -634,7 +636,7 @@ next_iput: goto next_step; if (gc_type == FG_GC) { - f2fs_submit_merged_bio(sbi, DATA, true, WRITE); + f2fs_submit_merged_bio(sbi, DATA, WRITE); /* * In the case of FG_GC, it'd be better to reclaim this victim |