[PATCH 3/9] drivers:mtd:ubi:add metadata struct for UBI bakvol

Boris Brezillon boris.brezillon at free-electrons.com
Mon Sep 28 03:06:51 PDT 2015


On Mon, 28 Sep 2015 07:02:42 +0000
Bean Huo 霍斌斌 (beanhuo) <beanhuo at micron.com> wrote:

> Add metadata struct for UBI bakvol.
> Currently , bakvol reserves 20 PEBs for internal log volume.
> Shares wear-leveling operation with ubi. 
> 
> 
> Signed-off-by: Bean Huo <beanhuo at micron.com>
> ---
>  drivers/mtd/ubi/ubi-media.h | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 

[...]

>  
> @@ -325,6 +339,32 @@ struct ubi_vid_hdr {
>  #define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(__be32))
>  
>  /**
> + * struct ubi_bkblk_info - the information for one backup block .
> + * @pbn: physical block number
> + * @lbn:  logic block number
> + * @plane: this block belongs to which plane
> + * @pgnum: the page number (lower page) that can be programmed last time
> + */

I'm not sure to understand what those fields are used for, but I guess
I'll understand it while reviewing the following patches.

> +struct ubi_bkblk_info {
> +	__be32  pbn;
> +	__be32  lbn;
> +	__u8    plane;
> +	__be32  pgnum;
> +	struct  list_head node;
> +};

You're mixing runtime and storage representation: node has nothing to
do here.

> +
> +/**
> + * struct ubi_bkblk_tbl - a table for backup blocks.
> + * @volume_built: indicate if backup volume be initted
> + * @bcount_of_plane:  block count that has bee applied for corresponding plane
> + */
> +struct ubi_bkblk_tbl {
> +	__u8    volume_built;
> +	__be32  bcount_of_plane[2];
> +	struct  list_head head;
> +};

Ditto.



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the linux-mtd mailing list