[PATCH]Add JFFS2 eraseblock header support

zhao forrest zhao_fusheng at hotmail.com
Tue Sep 20 22:22:54 EDT 2005


>
>+struct jffs2_eraseblock_header
>+{
>+       jint16_t magic;
>+       jint16_t nodetype; /* == JFFS2_NODETYPE_ERASEBLOCK_HEADER */
>+       jint32_t totlen;
>+       jint32_t hdr_crc;
>+       jint32_t fs_version; /* the version of this JFFS2 fs image */
>Well, I assume we may have 3 fields here:
>u8 version;
>u8 compat_fset;
>u8 incompat_fset;
>u8 rocompat_fset;

OK. I'll modify the patch to add support for these 3 new fields.

>
>+       jint32_t erase_count; /* the erase count of this erase block */
>4 bytes enough?
>

Yes. Now the erase cycles of flash erase block is about 100,000. So 4 
bytes is enough.

>+       jint16_t dsize; /* the size of additional data behind node_crc */
>What for?

This is for future extension. For example, if we decide to add more fields
into eraseblock_header in the future, they'll be appended to
eraseblock_header. dsize tells the data length of appended data; 
data_crc tells the crc of appended data.

>
>+       jint32_t node_crc;
>+       jint32_t data_crc;
>+       jint32_t data[0];
>+} __attribute__((packed));
>+
>
>






More information about the linux-mtd mailing list