[PATCH 3/6] UBI: Fastmap: Set used_ebs only for static volumes

2014-11-30 Thread Richard Weinberger
If we set it for dynamic ones we might confuse various self checks.

Signed-off-by: Richard Weinberger 
---
 drivers/mtd/ubi/fastmap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 5db41a5..749e2e4 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -136,14 +136,15 @@ static struct ubi_ainf_volume *add_vol(struct 
ubi_attach_info *ai, int vol_id,
if (!av)
goto out;
 
-   av->highest_lnum = av->leb_count = 0;
+   av->highest_lnum = av->leb_count = av->used_ebs = 0;
av->vol_id = vol_id;
-   av->used_ebs = used_ebs;
av->data_pad = data_pad;
av->last_data_size = last_eb_bytes;
av->compat = 0;
av->vol_type = vol_type;
av->root = RB_ROOT;
+   if (av->vol_type == UBI_STATIC_VOLUME)
+   av->used_ebs = used_ebs;
 
dbg_bld("found volume (ID %i)", vol_id);
 
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/6] UBI: Fastmap: Set used_ebs only for static volumes

2014-11-30 Thread Richard Weinberger
If we set it for dynamic ones we might confuse various self checks.

Signed-off-by: Richard Weinberger rich...@nod.at
---
 drivers/mtd/ubi/fastmap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 5db41a5..749e2e4 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -136,14 +136,15 @@ static struct ubi_ainf_volume *add_vol(struct 
ubi_attach_info *ai, int vol_id,
if (!av)
goto out;
 
-   av-highest_lnum = av-leb_count = 0;
+   av-highest_lnum = av-leb_count = av-used_ebs = 0;
av-vol_id = vol_id;
-   av-used_ebs = used_ebs;
av-data_pad = data_pad;
av-last_data_size = last_eb_bytes;
av-compat = 0;
av-vol_type = vol_type;
av-root = RB_ROOT;
+   if (av-vol_type == UBI_STATIC_VOLUME)
+   av-used_ebs = used_ebs;
 
dbg_bld(found volume (ID %i), vol_id);
 
-- 
1.8.4.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/