diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-14 12:17:40 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-16 07:50:16 -0400 |
commit | 92d124f5314913a21f7fa98b22ee457dab171edd (patch) | |
tree | 8a8c187f12290424419f0a05caeb202cd73253cc /drivers/mtd/ubi/vmt.c | |
parent | b342efd4a49cef9cf1a260c1814aad97722f38f8 (diff) |
UBI: make self-checks dynamic
This patch adds a possibility to dynamically switch UBI self-checks
on and off, instead of toggling them compile-time from the configuration
menu. This is much more flexible, and consistent with UBIFS, and this
also simplifies UBI Kconfig menu and the code.
This patch introduces two levels of self-checks - general, which
includes all self-checks which are relatively fast, and I/O, which
includes write-verify checks and erase-verify checks, which are
relatively slow and involve flash I/O.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/vmt.c')
-rw-r--r-- | drivers/mtd/ubi/vmt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index c47620dfc722..b79e0dea3632 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include "ubi.h" | 29 | #include "ubi.h" |
30 | 30 | ||
31 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID | 31 | #ifdef CONFIG_MTD_UBI_DEBUG |
32 | static int paranoid_check_volumes(struct ubi_device *ubi); | 32 | static int paranoid_check_volumes(struct ubi_device *ubi); |
33 | #else | 33 | #else |
34 | #define paranoid_check_volumes(ubi) 0 | 34 | #define paranoid_check_volumes(ubi) 0 |
@@ -711,7 +711,7 @@ void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol) | |||
711 | volume_sysfs_close(vol); | 711 | volume_sysfs_close(vol); |
712 | } | 712 | } |
713 | 713 | ||
714 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID | 714 | #ifdef CONFIG_MTD_UBI_DEBUG |
715 | 715 | ||
716 | /** | 716 | /** |
717 | * paranoid_check_volume - check volume information. | 717 | * paranoid_check_volume - check volume information. |
@@ -876,6 +876,9 @@ static int paranoid_check_volumes(struct ubi_device *ubi) | |||
876 | { | 876 | { |
877 | int i, err = 0; | 877 | int i, err = 0; |
878 | 878 | ||
879 | if (!(ubi_chk_flags & UBI_CHK_GEN)) | ||
880 | return 0; | ||
881 | |||
879 | for (i = 0; i < ubi->vtbl_slots; i++) { | 882 | for (i = 0; i < ubi->vtbl_slots; i++) { |
880 | err = paranoid_check_volume(ubi, i); | 883 | err = paranoid_check_volume(ubi, i); |
881 | if (err) | 884 | if (err) |