瀏覽代碼

jffs2: Wake GC thread when there are blocks to be erased

Now that we trigger block erases from jffs2_garbage_collect_pass(),
adjust jffs2_thread_should_wake() to return 1 when there are blocks to
erase.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Joakim Tjernlund 15 年之前
父節點
當前提交
d6ce171069
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      fs/jffs2/nodemgmt.c

+ 4 - 0
fs/jffs2/nodemgmt.c

@@ -744,6 +744,10 @@ int jffs2_thread_should_wake(struct jffs2_sb_info *c)
 	int nr_very_dirty = 0;
 	int nr_very_dirty = 0;
 	struct jffs2_eraseblock *jeb;
 	struct jffs2_eraseblock *jeb;
 
 
+	if (!list_empty(&c->erase_complete_list) ||
+	    !list_empty(&c->erase_pending_list))
+		return 1;
+
 	if (c->unchecked_size) {
 	if (c->unchecked_size) {
 		D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): unchecked_size %d, checked_ino #%d\n",
 		D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): unchecked_size %d, checked_ino #%d\n",
 			  c->unchecked_size, c->checked_ino));
 			  c->unchecked_size, c->checked_ino));