Commit cf740403 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: trival cleanup in move_data_block()

Trival cleanups:
- relocate set_summary() before its use
- relocate "allocate block address" to correct place
- remove unneeded f2fs_wait_on_page_writeback()
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 2562515f
...@@ -1169,8 +1169,6 @@ static int move_data_block(struct inode *inode, block_t bidx, ...@@ -1169,8 +1169,6 @@ static int move_data_block(struct inode *inode, block_t bidx,
if (err) if (err)
goto put_out; goto put_out;
set_summary(&sum, dn.nid, dn.ofs_in_node, ni.version);
/* read page */ /* read page */
fio.page = page; fio.page = page;
fio.new_blkaddr = fio.old_blkaddr = dn.data_blkaddr; fio.new_blkaddr = fio.old_blkaddr = dn.data_blkaddr;
...@@ -1207,6 +1205,9 @@ static int move_data_block(struct inode *inode, block_t bidx, ...@@ -1207,6 +1205,9 @@ static int move_data_block(struct inode *inode, block_t bidx,
} }
} }
set_summary(&sum, dn.nid, dn.ofs_in_node, ni.version);
/* allocate block address */
f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr, f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr,
&sum, type, NULL); &sum, type, NULL);
...@@ -1233,9 +1234,6 @@ static int move_data_block(struct inode *inode, block_t bidx, ...@@ -1233,9 +1234,6 @@ static int move_data_block(struct inode *inode, block_t bidx,
set_page_writeback(fio.encrypted_page); set_page_writeback(fio.encrypted_page);
ClearPageError(page); ClearPageError(page);
/* allocate block address */
f2fs_wait_on_page_writeback(dn.node_page, NODE, true, true);
fio.op = REQ_OP_WRITE; fio.op = REQ_OP_WRITE;
fio.op_flags = REQ_SYNC; fio.op_flags = REQ_SYNC;
fio.new_blkaddr = newaddr; fio.new_blkaddr = newaddr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment