[RFC][PATCH 5/7] MTD: UBI: Make process_eb() checkpoint aware

Richard Weinberger
2012-02-14T20:55:03Z

If CONFIG_MTD_UBI_CHECKPOINT is not set, process_eb has to
remove all checkpointing volumes.

Signed-off-by: Richard Weinberger <rw@linutronix.de>
---
drivers/mtd/ubi/scan.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index 0cb17d9..1d01fdc 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -1011,7 +1011,15 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
}

vol_id = be32_to_cpu(vidh->vol_id);
- if (vol_id > UBI_MAX_VOLUMES && vol_id != UBI_LAYOUT_VOLUME_ID) {
+#ifdef CONFIG_MTD_UBI_CHECKPOINT
+ if (vol_id > UBI_MAX_VOLUMES &&
+ vol_id != UBI_LAYOUT_VOLUME_ID &&
+ vol_id != UBI_CP_SB_VOLUME_ID &&
+ vol_id != UBI_CP_DATA_VOLUME_ID)
+#else
+ if (vol_id > UBI_MAX_VOLUMES && vol_id != UBI_LAYOUT_VOLUME_ID)
+#endif
+ {
int lnum = be32_to_cpu(vidh->lnum);

/* Unsupported internal volume */
--
1.7.7