Skip to contentSkip to conversation

f2fs: don't need to collect dirty sit entries and flush journal when there's no dirty sit entries

PATCH In review Wanpeng Li 1 participant 2 messages Feb 27, 2015

Subsystems (2)
lore
Share & tools
lore

Wanpeng Li

author
#0 lore raw

PATCH 1/1 f2fs: don't need to collect dirty sit entries and flush journal when there's no dirty sit entries

---
 fs/f2fs/segment.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/f2fs/segment.c +3 -3
index daee4ab..e7b83b6 100644
@@ -1730,6 +1730,9 @@ void flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 	mutex_lock(&curseg->curseg_mutex);
 	mutex_lock(&sit_i->sentry_lock);
 
+	if (!sit_i->dirty_sentries)
+		goto out;
+
 	/*
 	 * add and account sit entries of dirty bitmap in sit entry
 	 * set temporarily
@@ -1744,9 +1747,6 @@ void flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 	if (!__has_cursum_space(sum, sit_i->dirty_sentries, SIT_JOURNAL))
 		remove_sits_in_journal(sbi);
 
-	if (!sit_i->dirty_sentries)
-		goto out;
-
 	/*
 	 * there are two steps to flush sit entries:
 	 * #1, flush sit entries to journal in current cold data summary block.
Signature · 1 line
1.9.1
author
#1 lore raw

Please ignore this one which w/o patch description.

Quoted 31 lines · Wanpeng Li

---
fs/f2fs/segment.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
fs/f2fs/segment.c +3 -3
index daee4ab..e7b83b6 100644
@@ -1730,6 +1730,9 @@ void flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 	mutex_lock(&curseg->curseg_mutex);
 	mutex_lock(&sit_i->sentry_lock);
 
+	if (!sit_i->dirty_sentries)
+		goto out;
+
 	/*
 	 * add and account sit entries of dirty bitmap in sit entry
 	 * set temporarily
@@ -1744,9 +1747,6 @@ void flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 	if (!__has_cursum_space(sum, sit_i->dirty_sentries, SIT_JOURNAL))
 		remove_sits_in_journal(sbi);
 
-	if (!sit_i->dirty_sentries)
-		goto out;
-
 	/*
 	 * there are two steps to flush sit entries:
 	 * #1, flush sit entries to journal in current cold data summary block.
Signature · 1 line
1.9.1