summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-05-28 19:15:35 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-06-02 09:52:07 -0700
commit528e34593d6eff11a289ef23452c66175a340f0b (patch)
treeee116eb15e84ee2837207649a484c999d7a2c66f /fs/f2fs/file.c
parent96c6dd59bf1d8b30afd3681550b321f4183e1914 (diff)
downloadlinux-528e34593d6eff11a289ef23452c66175a340f0b.tar.bz2
f2fs: hide common code in f2fs_replace_block
This patch clean up codes through: 1.rename f2fs_replace_block to __f2fs_replace_block(). 2.introduce new f2fs_replace_block() to include __f2fs_replace_block() and some common related codes around __f2fs_replace_block(). Then, newly introduced function f2fs_replace_block can be used by following patch. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 6b4ba7429dba..aec96d3f8222 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -854,18 +854,10 @@ static int f2fs_do_collapse(struct inode *inode, pgoff_t start, pgoff_t end)
set_data_blkaddr(&dn);
} else if (new_addr != NEW_ADDR) {
struct node_info ni;
- struct f2fs_summary sum;
get_node_info(sbi, dn.nid, &ni);
- set_summary(&sum, dn.nid, dn.ofs_in_node,
- ni.version);
-
- f2fs_replace_block(sbi, &sum, old_addr,
- new_addr, true);
-
- dn.data_blkaddr = new_addr;
- set_data_blkaddr(&dn);
- f2fs_update_extent_cache(&dn);
+ f2fs_replace_block(sbi, &dn, old_addr, new_addr,
+ ni.version, true);
}
f2fs_put_dnode(&dn);