aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-12-31 02:08:26 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2015-01-09 20:02:26 -0500
commit3547ea961dd66a474c6f709c4f5e8a2472289df9 (patch)
tree5954b5b018bf72806283a10398e0a507c151c453 /fs
parente1509cf294cc670cda1fedd430f0ff175c42b591 (diff)
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')
-rw-r--r--fs/f2fs/data.c5
-rw-r--r--fs/f2fs/node.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 2c0cb6617918..155885bf714c 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -299,8 +299,6 @@ void update_extent_cache(struct dnode_of_data *dn)
299 int need_update = true; 299 int need_update = true;
300 300
301 f2fs_bug_on(F2FS_I_SB(dn->inode), dn->data_blkaddr == NEW_ADDR); 301 f2fs_bug_on(F2FS_I_SB(dn->inode), dn->data_blkaddr == NEW_ADDR);
302 fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
303 dn->ofs_in_node;
304 302
305 /* Update the page address in the parent node */ 303 /* Update the page address in the parent node */
306 __set_data_blkaddr(dn); 304 __set_data_blkaddr(dn);
@@ -308,6 +306,9 @@ void update_extent_cache(struct dnode_of_data *dn)
308 if (is_inode_flag_set(fi, FI_NO_EXTENT)) 306 if (is_inode_flag_set(fi, FI_NO_EXTENT))
309 return; 307 return;
310 308
309 fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
310 dn->ofs_in_node;
311
311 write_lock(&fi->ext.ext_lock); 312 write_lock(&fi->ext.ext_lock);
312 313
313 start_fofs = fi->ext.fofs; 314 start_fofs = fi->ext.fofs;
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a7cb0db2e3e8..9bed0161efee 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -348,7 +348,6 @@ void get_node_info(struct f2fs_sb_info *sbi, nid_t nid, struct node_info *ni)
348 struct nat_entry *e; 348 struct nat_entry *e;
349 int i; 349 int i;
350 350
351 memset(&ne, 0, sizeof(struct f2fs_nat_entry));
352 ni->nid = nid; 351 ni->nid = nid;
353 352
354 /* Check nat cache */ 353 /* Check nat cache */
@@ -363,6 +362,8 @@ void get_node_info(struct f2fs_sb_info *sbi, nid_t nid, struct node_info *ni)
363 if (e) 362 if (e)
364 return; 363 return;
365 364
365 memset(&ne, 0, sizeof(struct f2fs_nat_entry));
366
366 /* Check current segment summary */ 367 /* Check current segment summary */
367 mutex_lock(&curseg->curseg_mutex); 368 mutex_lock(&curseg->curseg_mutex);
368 i = lookup_journal_in_cursum(sum, NAT_JOURNAL, nid, 0); 369 i = lookup_journal_in_cursum(sum, NAT_JOURNAL, nid, 0);