[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CLEANMARKER obsolete, last-ic cache.



----- Original Message -----
From: "David Woodhouse" <dwmw2@xxxxxxx.org>
>
> Your optimisation of checking for a cleanmarker and avoiding the scan for
> 0xFF will still be possible, if you can work out a way to make it reliable
> with older filesystems that didn't obsolete the cleanmarker. You just put
> that check before the large read at the beginning of
jffs2_scan_eraseblock().

This is what I did in the 2.4 branch to test my theory.
It works for me, but I may be way off here.

    Jocke
 Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.51.2.2
diff -u -r1.51.2.2 scan.c
--- scan.c      2002/02/23 13:34:31     1.51.2.2
+++ scan.c      2002/03/03 00:15:58
@@ -295,6 +295,18 @@
                                jeb->first_node = jeb->last_node =
marker_ref;

                                USED_SPACE(PAD(sizeof(struct
jffs2_unknown_node)));
+                               err = c->mtd->read(c->mtd, ofs+sizeof(struct
jffs2_u
nknown_node),
+                                                   sizeof(node), &retlen,
(char *)&
node);
+                                if (node.magic == JFFS2_EMPTY_BITMASK &&
+                                    node.nodetype == JFFS2_EMPTY_BITMASK) {
+                                       /* We need to check if the first
bits
+                                          after the CLEANMARKER is empty
since
+                                          older FSes does not obsolete
dirty EB's
+                                       */
+
+                                       ofs += c->sector_size;
+                                       break;
+                                }
                        }
                        ofs += PAD(sizeof(struct jffs2_unknown_node));
                        break;



To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com