mtd/fs/jffs2 build.c,1.37,1.38
David Woodhouse
dwmw2 at infradead.org
Fri Aug 23 08:21:39 EDT 2002
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv16001
Modified Files:
build.c
Log Message:
Some cond_resched() to be nice during mounting
Index: build.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/build.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- build.c 20 Aug 2002 15:41:28 -0000 1.37
+++ build.c 23 Aug 2002 12:21:36 -0000 1.38
@@ -53,6 +53,7 @@
D1(printk(KERN_WARNING "Eep. jffs2_build_inode_pass1 for ino %d returned %d\n", ic->ino, ret));
return ret;
}
+ cond_resched();
}
D1(printk(KERN_DEBUG "Pass 1 complete\n"));
D1(jffs2_dump_block_lists(c));
@@ -70,6 +71,8 @@
if (ic->nlink)
continue;
+ /* XXX: Can get high latency here. Move the cond_resched() from the end of the loop? */
+
ret = jffs2_build_remove_unlinked_inode(c, ic);
if (ret)
break;
@@ -78,8 +81,11 @@
gone to zero too. So we have to restart the scan. */
}
D1(jffs2_dump_block_lists(c));
- } while(ret == -EAGAIN);
+
+ cond_resched();
+ } while(ret == -EAGAIN);
+
D1(printk(KERN_DEBUG "Pass 2 complete\n"));
/* Finally, we can scan again and free the dirent nodes and scan_info structs */
@@ -100,6 +106,7 @@
jffs2_free_full_dirent(fd);
}
kfree(scan);
+ cond_resched();
}
D1(printk(KERN_DEBUG "Pass 3 complete\n"));
D1(jffs2_dump_block_lists(c));
@@ -188,6 +195,8 @@
struct jffs2_inode_cache *child_ic;
if (!fd->ino)
continue;
+
+ /* XXX: Can get high latency here with huge directories */
child_ic = jffs2_get_ino_cache(c, fd->ino);
if (!child_ic) {
More information about the linux-mtd-cvs
mailing list