]> err.no Git - linux-2.6/blobdiff - fs/jffs2/scan.c
[JFFS2] Remove forgotten summary code
[linux-2.6] / fs / jffs2 / scan.c
index 3e51dd1da8aa7f271dc1205139d9dc0d658cec52..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;
 }
 
@@ -365,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);