]> err.no Git - linux-2.6/blobdiff - fs/jffs2/nodemgmt.c
[PATCH] do_notify_parent_cldstop() cleanup
[linux-2.6] / fs / jffs2 / nodemgmt.c
index 456adf020f22439caa661a629a591fdd2a27e43c..c1d8b5ed9ab95221b89b2af4bbcdd985de16775f 100644 (file)
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: nodemgmt.c,v 1.119 2005/02/28 08:21:05 dedekind Exp $
+ * $Id: nodemgmt.c,v 1.122 2005/05/06 09:30:27 dedekind Exp $
  *
  */
 
@@ -75,7 +75,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs
                        dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks * c->sector_size + c->unchecked_size;
                        if (dirty < c->nospc_dirty_size) {
                                if (prio == ALLOC_DELETION && c->nr_free_blocks + c->nr_erasing_blocks >= c->resv_blocks_deletion) {
-                                       printk(KERN_NOTICE "jffs2_reserve_space(): Low on dirty space to GC, but it's a deletion. Allowing...\n");
+                                       D1(printk(KERN_NOTICE "jffs2_reserve_space(): Low on dirty space to GC, but it's a deletion. Allowing...\n"));
                                        break;
                                }
                                D1(printk(KERN_DEBUG "dirty size 0x%08x + unchecked_size 0x%08x < nospc_dirty_size 0x%08x, returning -ENOSPC\n",
@@ -98,7 +98,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs
                        avail = c->free_size + c->dirty_size + c->erasing_size + c->unchecked_size;
                        if ( (avail / c->sector_size) <= blocksneeded) {
                                if (prio == ALLOC_DELETION && c->nr_free_blocks + c->nr_erasing_blocks >= c->resv_blocks_deletion) {
-                                       printk(KERN_NOTICE "jffs2_reserve_space(): Low on possibly available space, but it's a deletion. Allowing...\n");
+                                       D1(printk(KERN_NOTICE "jffs2_reserve_space(): Low on possibly available space, but it's a deletion. Allowing...\n"));
                                        break;
                                }
 
@@ -437,7 +437,7 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
 
        // Take care, that wasted size is taken into concern
        if ((jeb->dirty_size || ISDIRTY(jeb->wasted_size + ref_totlen(c, jeb, ref))) && jeb != c->nextblock) {
-               D1(printk("Dirtying\n"));
+               D1(printk(KERN_DEBUG "Dirtying\n"));
                addedsize = ref_totlen(c, jeb, ref);
                jeb->dirty_size += ref_totlen(c, jeb, ref);
                c->dirty_size += ref_totlen(c, jeb, ref);
@@ -459,7 +459,7 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
                        }
                }
        } else {
-               D1(printk("Wasting\n"));
+               D1(printk(KERN_DEBUG "Wasting\n"));
                addedsize = 0;
                jeb->wasted_size += ref_totlen(c, jeb, ref);
                c->wasted_size += ref_totlen(c, jeb, ref);      
@@ -594,7 +594,7 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
                *p = ref->next_in_ino;
                ref->next_in_ino = NULL;
 
-               if (ic->nodes == (void *)ic)
+               if (ic->nodes == (void *)ic && ic->nlink == 0)
                        jffs2_del_ino_cache(c, ic);
 
                spin_unlock(&c->erase_completion_lock);