[04/14] ubi: fastmap: Add UBI_FM_SB_PRESEEDED_FLG flag

Message ID 20180613212344.11608-5-richard@nod.at
State Under Review
Delegated to: Richard Weinberger
Headers show
Series
  • ubi: Fastmap updates
Related show

Commit Message

Richard Weinberger June 13, 2018, 9:23 p.m.
This flag indicates that the fastmap was preseeded, which means
it was created offline by a tool such as ubinize which cannot know
the whole MTD state such as real size and bad blocks.
As consequence UBI has to take special care to use that fastmap.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/ubi-media.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Boris Brezillon June 24, 2018, 12:53 p.m. | #1
On Wed, 13 Jun 2018 23:23:34 +0200
Richard Weinberger <richard@nod.at> wrote:

> This flag indicates that the fastmap was preseeded, which means
> it was created offline by a tool such as ubinize which cannot know
> the whole MTD state such as real size and bad blocks.
> As consequence UBI has to take special care to use that fastmap.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>
> ---
>  drivers/mtd/ubi/ubi-media.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/ubi/ubi-media.h b/drivers/mtd/ubi/ubi-media.h
> index 6136a97f4844..be339fb924af 100644
> --- a/drivers/mtd/ubi/ubi-media.h
> +++ b/drivers/mtd/ubi/ubi-media.h
> @@ -390,7 +390,11 @@ struct ubi_vtbl_record {
>  #define UBI_FM_MIN_POOL_SIZE	8
>  #define UBI_FM_MAX_POOL_SIZE	256
>  
> -#define UBI_FM_SB_FLG_MASK	0
> +enum {
> +	UBI_FM_SB_PRESEEDED_FLG	= 0x1,
> +};
> +
> +#define UBI_FM_SB_FLG_MASK (UBI_FM_SB_PRESEEDED_FLG)

You update the def that you use to check when a flag is supported,
still, you do not support this feature yet. Better move this line after
the support is really functional, don't you think?

Patch

diff --git a/drivers/mtd/ubi/ubi-media.h b/drivers/mtd/ubi/ubi-media.h
index 6136a97f4844..be339fb924af 100644
--- a/drivers/mtd/ubi/ubi-media.h
+++ b/drivers/mtd/ubi/ubi-media.h
@@ -390,7 +390,11 @@  struct ubi_vtbl_record {
 #define UBI_FM_MIN_POOL_SIZE	8
 #define UBI_FM_MAX_POOL_SIZE	256
 
-#define UBI_FM_SB_FLG_MASK	0
+enum {
+	UBI_FM_SB_PRESEEDED_FLG	= 0x1,
+};
+
+#define UBI_FM_SB_FLG_MASK (UBI_FM_SB_PRESEEDED_FLG)
 
 /**
  * struct ubi_fm_sb - UBI fastmap super block