linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Remove an unnecessary line in allocate_data_block.
@ 2014-07-30  3:54 Dongho Sim
  0 siblings, 0 replies; only message in thread
From: Dongho Sim @ 2014-07-30  3:54 UTC (permalink / raw)
  To: jaegeuk@kernel.org; +Cc: linux-f2fs-devel@lists.sourceforge.net

Hi. There was an unnecessary line in function, allocate_data_block.

In this function, we already choosed old curseg(Y) and then we always allocate new address(∈Y) from it.
After that we call refresh_sit_entry(sbi, old_blkaddr, *new_blkaddr).
In that function, we call located_dirty_segment with old seg(X) and old curseg(Y).

So, because we've done about old curseg(Y), 
calling locate_dirty_segment(sbi, old_cursegno) again is redundant.

Thanks. :-)


Signed-off-by: Dongho Sim <dh.sim@samsung.com>
---
 fs/f2fs/segment.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 8a6e57d..7af4a8d 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -973,14 +973,12 @@ void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
 {
  struct sit_info *sit_i = SIT_I(sbi);
  struct curseg_info *curseg;
- unsigned int old_cursegno;
 
  curseg = CURSEG_I(sbi, type);
 
  mutex_lock(&curseg->curseg_mutex);
 
  *new_blkaddr = NEXT_FREE_BLKADDR(sbi, curseg);
- old_cursegno = curseg->segno;
 
  /*
   * __add_sum_entry should be resided under the curseg_mutex
@@ -1001,7 +999,6 @@ void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
   * since SSR needs latest valid block information.
   */
  refresh_sit_entry(sbi, old_blkaddr, *new_blkaddr);
- locate_dirty_segment(sbi, old_cursegno);
 
  mutex_unlock(&sit_i->sentry_lock);
 
-- 
1.9.1
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-30  3:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30  3:54 [PATCH v2] Remove an unnecessary line in allocate_data_block Dongho Sim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).