diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-11 13:54:01 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-23 10:18:06 +0900 |
commit | 458e6197c37de53f7be0a837644daabb900c3036 (patch) | |
tree | 248c02467c0c1f8d84a8e6c23700620a939f3c58 /fs/f2fs/super.c | |
parent | 63a0b7cb33d85aeb0df39b984c08e234db4925d1 (diff) |
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/super.c')
-rw-r--r-- | fs/f2fs/super.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 68df44afd14..1674f2f9970 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -885,8 +885,13 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) spin_lock_init(&sbi->stat_lock); mutex_init(&sbi->read_io.io_mutex); - for (i = 0; i < NR_PAGE_TYPE; i++) + sbi->read_io.sbi = sbi; + sbi->read_io.bio = NULL; + for (i = 0; i < NR_PAGE_TYPE; i++) { mutex_init(&sbi->write_io[i].io_mutex); + sbi->write_io[i].sbi = sbi; + sbi->write_io[i].bio = NULL; + } init_rwsem(&sbi->cp_rwsem); init_waitqueue_head(&sbi->cp_wait); |