diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-12-17 19:33:13 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-01-09 17:02:23 -0800 |
commit | cf04e8eb55290c7b836c36f0b4e1a8d0fe8ee275 (patch) | |
tree | 077ddb41b1d4eec5f4987efa1aa7e1bca021727d /fs/f2fs/node.c | |
parent | 9ecf4b80bd32ad727d7fca56706bb5b059935c18 (diff) | |
download | op-kernel-dev-cf04e8eb55290c7b836c36f0b4e1a8d0fe8ee275.zip op-kernel-dev-cf04e8eb55290c7b836c36f0b4e1a8d0fe8ee275.tar.gz |
f2fs: use f2fs_io_info to clean up messy parameters during IO path
This patch cleans up parameters on IO paths.
The key idea is to use f2fs_io_info adding a parameter, block address, and then
use this structure as parameters.
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index bcfd67c..adc35c9 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -977,6 +977,10 @@ static int read_node_page(struct page *page, int rw) { struct f2fs_sb_info *sbi = F2FS_P_SB(page); struct node_info ni; + struct f2fs_io_info fio = { + .type = NODE, + .rw = rw, + }; get_node_info(sbi, page->index, &ni); @@ -988,7 +992,8 @@ static int read_node_page(struct page *page, int rw) if (PageUptodate(page)) return LOCKED_PAGE; - return f2fs_submit_page_bio(sbi, page, ni.blk_addr, rw); + fio.blk_addr = ni.blk_addr; + return f2fs_submit_page_bio(sbi, page, &fio); } /* @@ -1269,7 +1274,6 @@ static int f2fs_write_node_page(struct page *page, { struct f2fs_sb_info *sbi = F2FS_P_SB(page); nid_t nid; - block_t new_addr; struct node_info ni; struct f2fs_io_info fio = { .type = NODE, @@ -1304,9 +1308,11 @@ static int f2fs_write_node_page(struct page *page, } else { down_read(&sbi->node_write); } + set_page_writeback(page); - write_node_page(sbi, page, &fio, nid, ni.blk_addr, &new_addr); - set_node_addr(sbi, &ni, new_addr, is_fsync_dnode(page)); + fio.blk_addr = ni.blk_addr; + write_node_page(sbi, page, nid, &fio); + set_node_addr(sbi, &ni, fio.blk_addr, is_fsync_dnode(page)); dec_page_count(sbi, F2FS_DIRTY_NODES); up_read(&sbi->node_write); unlock_page(page); |