summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-12-30 23:08:26 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-01-09 17:02:26 -0800
commit3547ea961dd66a474c6f709c4f5e8a2472289df9 (patch)
tree5954b5b018bf72806283a10398e0a507c151c453 /fs/f2fs/data.c
parente1509cf294cc670cda1fedd430f0ff175c42b591 (diff)
downloadop-kernel-dev-3547ea961dd66a474c6f709c4f5e8a2472289df9.zip
op-kernel-dev-3547ea961dd66a474c6f709c4f5e8a2472289df9.tar.gz
f2fs: avoid potential unnecessary codes
This patch relocates some operations to avoid unnecessary execution. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 2c0cb66..155885b 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -299,8 +299,6 @@ void update_extent_cache(struct dnode_of_data *dn)
int need_update = true;
f2fs_bug_on(F2FS_I_SB(dn->inode), dn->data_blkaddr == NEW_ADDR);
- fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
- dn->ofs_in_node;
/* Update the page address in the parent node */
__set_data_blkaddr(dn);
@@ -308,6 +306,9 @@ void update_extent_cache(struct dnode_of_data *dn)
if (is_inode_flag_set(fi, FI_NO_EXTENT))
return;
+ fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
+ dn->ofs_in_node;
+
write_lock(&fi->ext.ext_lock);
start_fofs = fi->ext.fofs;
OpenPOWER on IntegriCloud