[PATCH]erase block header(revision 3)

Jörn Engel joern at wohnheim.fh-wedel.de
Tue Sep 27 08:12:26 EDT 2005


On Tue, 27 September 2005 15:51:42 +0800, zhao forrest wrote:
> 
> This is the revision 3 of erase block header patch.
> Compare with revision 2, the main changes are:
> 1 to keep consistency, rename struct jffs2_eraseblock_header
> to struct jffs2_raw_ebh
> 2 change the type of has_ebh to uint32_t
> 3 store the real length into totlen
> 4 rename fs_version into reserved in order to give it a
> useful name.


> diff -auNrp ./mtd/fs/jffs2/erase.c ./mtd_EBH_EBS/fs/jffs2/erase.c
> --- ./mtd/fs/jffs2/erase.c	2005-09-22 11:08:47.000000000 +0800
> +++ ./mtd_EBH_EBS/fs/jffs2/erase.c	2005-09-27 15:30:26.000000000 +0800
> @@ -210,6 +210,10 @@ static void jffs2_erase_callback(struct 
>  	} else {
>  		jffs2_erase_succeeded(priv->c, priv->jeb);
>  	}	
> +
> +	if (!priv->jeb->has_ebh) {
> +		priv->jeb->has_ebh = 1;
> +	}

The complete condition is bullock.  See last review.

>  	kfree(instr);
>  }
>  #endif /* !__ECOS */

[...]

> +struct jffs2_raw_ebh
> +{
> +	jint16_t magic;
> +	jint16_t nodetype; /* == JFFS2_NODETYPE_ERASEBLOCK_HEADER */
> +	jint32_t totlen;
> +	jint32_t hdr_crc;
> +	uint8_t  reserved; /* reserved for future use and alignment */
> +	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 */
> +	jint32_t node_crc;
> +	jint32_t data_crc;
> +	jint32_t data[0];
> +} __attribute__((packed));

Structure still doesn't make sense.  See my last review.

Jörn

-- 
Invincibility is in oneself, vulnerability is in the opponent.
-- Sun Tzu




More information about the linux-mtd mailing list