summaryrefslogtreecommitdiff
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-03-19 19:23:32 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-04-10 15:08:49 -0700
commit216a620a7c3d35ae604ba519c99c5cd1ce4dad6e (patch)
tree19a921c7d4480be6bacd33965b99d3d0b5248330 /fs/f2fs/data.c
parent368a0e40b5aedb036de3d78333571c8689869490 (diff)
f2fs: split set_data_blkaddr from f2fs_update_extent_cache
Split __set_data_blkaddr from f2fs_update_extent_cache for readability. Additionally rename __set_data_blkaddr to set_data_blkaddr for exporting. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 241b98741df9..6492f88a2cc4 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -200,7 +200,7 @@ alloc_new:
* ->node_page
* update block addresses in the node page
*/
-static void __set_data_blkaddr(struct dnode_of_data *dn)
+void set_data_blkaddr(struct dnode_of_data *dn)
{
struct f2fs_node *rn;
__le32 *addr_array;
@@ -229,7 +229,7 @@ int reserve_new_block(struct dnode_of_data *dn)
trace_f2fs_reserve_new_block(dn->inode, dn->nid, dn->ofs_in_node);
dn->data_blkaddr = NEW_ADDR;
- __set_data_blkaddr(dn);
+ set_data_blkaddr(dn);
mark_inode_dirty(dn->inode);
sync_inode_page(dn);
return 0;
@@ -784,9 +784,6 @@ void f2fs_update_extent_cache(struct dnode_of_data *dn)
f2fs_bug_on(F2FS_I_SB(dn->inode), dn->data_blkaddr == NEW_ADDR);
- /* Update the page address in the parent node */
- __set_data_blkaddr(dn);
-
if (is_inode_flag_set(fi, FI_NO_EXTENT))
return;
@@ -1032,7 +1029,7 @@ static int __allocate_data_block(struct dnode_of_data *dn)
allocate_data_block(sbi, NULL, NULL_ADDR, &dn->data_blkaddr, &sum, seg);
/* direct IO doesn't use extent cache to maximize the performance */
- __set_data_blkaddr(dn);
+ set_data_blkaddr(dn);
/* update i_size */
fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
@@ -1290,6 +1287,7 @@ int do_write_data_page(struct page *page, struct f2fs_io_info *fio)
trace_f2fs_do_write_data_page(page, IPU);
} else {
write_data_page(page, &dn, fio);
+ set_data_blkaddr(&dn);
f2fs_update_extent_cache(&dn);
trace_f2fs_do_write_data_page(page, OPU);
set_inode_flag(F2FS_I(inode), FI_APPEND_WRITE);