[PATCH]Erase block header(revision 1)
Jörn Engel
joern at wohnheim.fh-wedel.de
Sun Sep 25 07:04:12 EDT 2005
On Fri, 23 September 2005 14:53:09 +0800, zhao forrest wrote:
>
> This is the revised version of eraseblock header patch.
> Compared with previous version, the following changes are
> made:
> 1 eliminate the too long lines, and make them shorter
> 2 change eraseblock_heaer_size to ebh_size; has_eraseblock
> _header to has_ebh to avoid long variable name
> 3 change jffs2_write_nand_cleanmarker() to jffs2_write_nand_ebh()
> to avoid confusion
> 4 change jffs2_check_nand_cleanmarker() to
> jffs2_check_nand_cleanmarker_ebh() to avoid confusion
I ignored all the code and took a look at the new node type only.
> +struct jffs2_eraseblock_header
> +{
> + jint16_t magic;
> + jint16_t nodetype; /* == JFFS2_NODETYPE_ERASEBLOCK_HEADER */
> + jint32_t totlen;
> + jint32_t hdr_crc;
> + uint8_t fs_version; /* the version of this JFFS2 fs image */
Version is completely useless.
> + uint8_t compat_fset;
> + uint8_t incompat_fset;
> + uint8_t rocompat_fset;
> + jint32_t erase_count; /* the erase count of this erase block */
> + jint16_t dsize; /* the size of additional data behind node_crc */
Breaks alignment and pretty useless. Information can be deduced from
totlen. Remove.
> + jint32_t node_crc;
> + jint32_t data_crc;
Combine and move up, just below hdr_crc.
> + jint32_t data[0];
> +} __attribute__((packed));
> +
> struct jffs2_raw_dirent
> {
> jint16_t magic;
Jörn
--
Good warriors cause others to come to them and do not go to others.
-- Sun Tzu
More information about the linux-mtd
mailing list