]> err.no Git - linux-2.6/blobdiff - fs/jffs2/scan.c
[JFFS2] Remove forgotten summary code
[linux-2.6] / fs / jffs2 / scan.c
index 0e7456ec99fd05a778738da5ab69ec57cd1629a4..352ada892f3ec24fce5180aaa1cd2d1415a3a4c4 100644 (file)
@@ -222,9 +222,6 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
                }
        }
 
-       if (jffs2_sum_active() && s)
-               kfree(s);
-
        /* Nextblock dirty is always seen as wasted, because we cannot recycle it now */
        if (c->nextblock && (c->nextblock->dirty_size)) {
                c->nextblock->wasted_size += c->nextblock->dirty_size;
@@ -233,7 +230,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
                c->nextblock->dirty_size = 0;
        }
 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
-       if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
+       if (!jffs2_can_mark_obsolete(c) && c->wbuf_pagesize && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
                /* If we're going to start writing into a block which already
                   contains data, and the end of the data isn't page-aligned,
                   skip a little and align it. */
@@ -266,6 +263,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
        else
                c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size);
 #endif
+       if (s)
+               kfree(s);
+
        return ret;
 }
 
@@ -284,9 +284,6 @@ int jffs2_fill_scan_buf (struct jffs2_sb_info *c, void *buf,
                D1(printk(KERN_WARNING "Read at 0x%x gave only 0x%zx bytes\n", ofs, retlen));
                return -EIO;
        }
-       D2(printk(KERN_DEBUG "Read 0x%x bytes from 0x%08x into buf\n", len, ofs));
-       D2(printk(KERN_DEBUG "000: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
-                 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], buf[8], buf[9], buf[10], buf[11], buf[12], buf[13], buf[14], buf[15]));
        return 0;
 }
 
@@ -368,23 +365,12 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
                }
 
                kfree(sm);
-
-               ofs = jeb->offset;
-               prevofs = jeb->offset - 1;
        }
 
        buf_ofs = jeb->offset;
 
        if (!buf_size) {
                buf_len = c->sector_size;
-
-               if (jffs2_sum_active()) {
-                       /* must reread because of summary test */
-                       err = jffs2_fill_scan_buf(c, buf, buf_ofs, buf_len);
-                       if (err)
-                               return err;
-               }
-
        } else {
                buf_len = EMPTY_SCAN_SIZE(c->sector_size);
                err = jffs2_fill_scan_buf(c, buf, buf_ofs, buf_len);