Skip to contentSkip to conversation

f2fs: remove the unuseful "issue_tail" list

PATCH In review Gu Zheng 1 participant 2 messages Apr 11, 2014 – Apr 14, 2014

Subsystems (2)
lore
Share & tools
lore

Gu Zheng

author
#0 lore raw

PATCH 2/7 f2fs: remove the unuseful "issue_tail" list

With the issue_list and dispatch_list, we can handle flush_merge already, so remove the useless "issue_tail" list.

---
 fs/f2fs/f2fs.h    |    1 -
 fs/f2fs/segment.c |    5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)
fs/f2fs/f2fs.h +0 -1
index 2ecac83..90109fa 100644
@@ -358,7 +358,6 @@ struct f2fs_sm_info {
 	struct flush_cmd *issue_list;		/* list for command issue */
 	struct flush_cmd *dispatch_list;	/* list for command dispatch */
 	spinlock_t issue_lock;			/* for issue list lock */
-	struct flush_cmd *issue_tail;		/* list tail of issue list */
 };
 
 /*
fs/f2fs/segment.c +2 -3
index 524b7ed..8a6fe2a 100644
@@ -209,7 +209,7 @@ repeat:
 	spin_lock(&sm_i->issue_lock);
 	if (sm_i->issue_list) {
 		sm_i->dispatch_list = sm_i->issue_list;
-		sm_i->issue_list = sm_i->issue_tail = NULL;
+		sm_i->issue_list = NULL;
 	}
 	spin_unlock(&sm_i->issue_lock);
 
@@ -250,10 +250,9 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi)
 
 	spin_lock(&sm_i->issue_lock);
 	if (sm_i->issue_list)
-		sm_i->issue_tail->next = cmd;
+		sm_i->issue_list->next = cmd;
 	else
 		sm_i->issue_list = cmd;
-	sm_i->issue_tail = cmd;
 	spin_unlock(&sm_i->issue_lock);
 
 	if (!sm_i->dispatch_list)
Signature · 9 lines
1.7.7


------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
author
#1 lore raw

Hi All,
There seems to be a mistake in this patch, please ignore it. I'll send a reworked one later.

Regards,
Gu

Quoted 36 lines · Gu Zheng

With the issue_list and dispatch_list, we can handle flush_merge already, so remove the useless "issue_tail" list.

---
 fs/f2fs/f2fs.h    |    1 -
 fs/f2fs/segment.c |    5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)
fs/f2fs/f2fs.h +0 -1
index 2ecac83..90109fa 100644
@@ -358,7 +358,6 @@ struct f2fs_sm_info {
 	struct flush_cmd *issue_list;		/* list for command issue */
 	struct flush_cmd *dispatch_list;	/* list for command dispatch */
 	spinlock_t issue_lock;			/* for issue list lock */
-	struct flush_cmd *issue_tail;		/* list tail of issue list */
 };
 
 /*
fs/f2fs/segment.c +1 -1
index 524b7ed..8a6fe2a 100644
@@ -209,7 +209,7 @@ repeat:
 	spin_lock(&sm_i->issue_lock);
 	if (sm_i->issue_list) {
 		sm_i->dispatch_list = sm_i->issue_list;
-		sm_i->issue_list = sm_i->issue_tail = NULL;
+		sm_i->issue_list = NULL;
 	}
 	spin_unlock(&sm_i->issue_lock);
 
@@ -250,10 +250,9 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi)
 

fs/f2fs/segment.c int f2fs_issue_flush(struct f2fs_sb_info *sbi) · line 258

Quoted 10 lines
fs/f2fs/segment.c +1 -2
 	spin_lock(&sm_i->issue_lock);
 	if (sm_i->issue_list)
-		sm_i->issue_tail->next = cmd;
+		sm_i->issue_list->next = cmd;
 	else
 		sm_i->issue_list = cmd;
-	sm_i->issue_tail = cmd;
 	spin_unlock(&sm_i->issue_lock);
 
 	if (!sm_i->dispatch_list)

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech