aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodemgmt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-13 13:12:15 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-13 13:12:15 -0400
commitc8c55bcb43d790d97790cfa319d80045a71fde39 (patch)
treeb791d9478d3e7f1eb26e51bb999fde21847d4391 /fs/jffs2/nodemgmt.c
parent3749c66c67fb5c257771815c186bc32290cacf44 (diff)
parentebf8889bd1fe3615991ff4494635d237280652a2 (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (91 commits) [MTD] [NAND] Blackfin on-chip NAND Flash Controller driver [MTD] [NOR] fix ctrl-alt-del can't reboot for intel flash bug [MTD] [NAND] Fix compiler warning in Alauda driver [JFFS2] Remove stray debugging printk [JFFS2] Handle dirents on the flash with embedded zero bytes in names. [JFFS2] Check for creation of dirents with embedded zero bytes in name. [JFFS2] Don't count all 'very dirty' blocks except in debug mode [JFFS2] Check whether garbage-collection actually obsoleted its victim. [JFFS2] Relax threshold for triggering GC due to dirty blocks. [MTD] [OneNAND] Fix typo related with recent commit [JFFS2] Trigger garbage collection when very_dirty_list size becomes excessive [MTD] [NAND] Avoid deadlock in erase callback; release chip lock first. [MTD] [NAND] Resume method for CAFÉ NAND controller [MTD] [NAND] Fix PCI ident table for CAFÉ NAND controller. [MTD] [NAND] s3c2410: fix arch moves [MTD] [OneNAND] fix numerous races [MTD] map driver for NOR flash on the Intel Vermilion Range chipset [JFFS2] Fix unpoint length [MTD] fix CFI point method for discontiguous maps [MTD] MAPS: Merge Lubbock and Mainstone drivers into common PXA2xx driver ...
Diffstat (limited to 'fs/jffs2/nodemgmt.c')
-rw-r--r--fs/jffs2/nodemgmt.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index dbc908ad622b..a0313fa8748e 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -154,7 +154,7 @@ int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize,
154 while(ret == -EAGAIN) { 154 while(ret == -EAGAIN) {
155 ret = jffs2_do_reserve_space(c, minsize, len, sumsize); 155 ret = jffs2_do_reserve_space(c, minsize, len, sumsize);
156 if (ret) { 156 if (ret) {
157 D1(printk(KERN_DEBUG "jffs2_reserve_space_gc: looping, ret is %d\n", ret)); 157 D1(printk(KERN_DEBUG "jffs2_reserve_space_gc: looping, ret is %d\n", ret));
158 } 158 }
159 } 159 }
160 spin_unlock(&c->erase_completion_lock); 160 spin_unlock(&c->erase_completion_lock);
@@ -423,7 +423,12 @@ struct jffs2_raw_node_ref *jffs2_add_physical_node_ref(struct jffs2_sb_info *c,
423 even after refiling c->nextblock */ 423 even after refiling c->nextblock */
424 if ((c->nextblock || ((ofs & 3) != REF_OBSOLETE)) 424 if ((c->nextblock || ((ofs & 3) != REF_OBSOLETE))
425 && (jeb != c->nextblock || (ofs & ~3) != jeb->offset + (c->sector_size - jeb->free_size))) { 425 && (jeb != c->nextblock || (ofs & ~3) != jeb->offset + (c->sector_size - jeb->free_size))) {
426 printk(KERN_WARNING "argh. node added in wrong place\n"); 426 printk(KERN_WARNING "argh. node added in wrong place at 0x%08x(%d)\n", ofs & ~3, ofs & 3);
427 if (c->nextblock)
428 printk(KERN_WARNING "nextblock 0x%08x", c->nextblock->offset);
429 else
430 printk(KERN_WARNING "No nextblock");
431 printk(", expected at %08x\n", jeb->offset + (c->sector_size - jeb->free_size));
427 return ERR_PTR(-EINVAL); 432 return ERR_PTR(-EINVAL);
428 } 433 }
429#endif 434#endif
@@ -717,6 +722,8 @@ int jffs2_thread_should_wake(struct jffs2_sb_info *c)
717{ 722{
718 int ret = 0; 723 int ret = 0;
719 uint32_t dirty; 724 uint32_t dirty;
725 int nr_very_dirty = 0;
726 struct jffs2_eraseblock *jeb;
720 727
721 if (c->unchecked_size) { 728 if (c->unchecked_size) {
722 D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): unchecked_size %d, checked_ino #%d\n", 729 D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): unchecked_size %d, checked_ino #%d\n",
@@ -738,8 +745,18 @@ int jffs2_thread_should_wake(struct jffs2_sb_info *c)
738 (dirty > c->nospc_dirty_size)) 745 (dirty > c->nospc_dirty_size))
739 ret = 1; 746 ret = 1;
740 747
741 D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): nr_free_blocks %d, nr_erasing_blocks %d, dirty_size 0x%x: %s\n", 748 list_for_each_entry(jeb, &c->very_dirty_list, list) {
742 c->nr_free_blocks, c->nr_erasing_blocks, c->dirty_size, ret?"yes":"no")); 749 nr_very_dirty++;
750 if (nr_very_dirty == c->vdirty_blocks_gctrigger) {
751 ret = 1;
752 /* In debug mode, actually go through and count them all */
753 D1(continue);
754 break;
755 }
756 }
757
758 D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): nr_free_blocks %d, nr_erasing_blocks %d, dirty_size 0x%x, vdirty_blocks %d: %s\n",
759 c->nr_free_blocks, c->nr_erasing_blocks, c->dirty_size, nr_very_dirty, ret?"yes":"no"));
743 760
744 return ret; 761 return ret;
745} 762}