aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-03 10:11:37 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-10-19 10:19:57 -0400
commit0525dac9fd31e5a12fb934238abd09e2752a5967 (patch)
tree9f5f04c0d073d9c4e628afdaa5ad00a1504061f0 /drivers/mtd/ubi/scan.h
parent3fb34124da9d5e37576d9f87d7a5005ba1d82dd7 (diff)
UBI: do not put eraseblocks to the corrupted list unnecessarily
Currently UBI maintains 2 lists of PEBs during scanning: 1. 'erase' list - PEBs which have no corruptions but should be erased 2. 'corr' list - PEBs which have some corruptions and should be erased But we do not really need 2 lists for PEBs which should be erased after scanning is done - this is redundant. So this patch makes sure all PEBs which are corrupted are moved to the head of the 'erase' list. We add them to the head to make sure they are erased first and we get rid of corruption ASAP. However, we do not remove the 'corr' list and realted functions, because the plan is to use this list for other purposes. Namely, we plan to put eraseblocks with corruption which does not look like it was caused by unclean power cut. Then we'll preserve thes PEBs in order to avoid killing potentially valuable user data. This patch also amends PEBs accounting, because it was closely tight to the 'erase'/'corr' lists separation. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.h')
-rw-r--r--drivers/mtd/ubi/scan.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h
index 0876649318dd..12ac852c993b 100644
--- a/drivers/mtd/ubi/scan.h
+++ b/drivers/mtd/ubi/scan.h
@@ -91,14 +91,13 @@ struct ubi_scan_volume {
91 * @erase: list of physical eraseblocks which have to be erased 91 * @erase: list of physical eraseblocks which have to be erased
92 * @alien: list of physical eraseblocks which should not be used by UBI (e.g., 92 * @alien: list of physical eraseblocks which should not be used by UBI (e.g.,
93 * those belonging to "preserve"-compatible internal volumes) 93 * those belonging to "preserve"-compatible internal volumes)
94 * @used_peb_count: count of used PEBs
95 * @corr_peb_count: count of PEBs in the @corr list 94 * @corr_peb_count: count of PEBs in the @corr list
96 * @read_err_count: count of PEBs read with error (%UBI_IO_BAD_HDR_EBADMSG was 95 * @empty_peb_count: count of PEBs which are presumably empty (contain only
97 * returned) 96 * 0xFF bytes)
98 * @free_peb_count: count of PEBs in the @free list
99 * @erase_peb_count: count of PEBs in the @erase list
100 * @alien_peb_count: count of PEBs in the @alien list 97 * @alien_peb_count: count of PEBs in the @alien list
101 * @bad_peb_count: count of bad physical eraseblocks 98 * @bad_peb_count: count of bad physical eraseblocks
99 * @maybe_bad_peb_count: count of bad physical eraseblocks which are not marked
100 * as bad yet, but which look like bad
102 * @vols_found: number of volumes found during scanning 101 * @vols_found: number of volumes found during scanning
103 * @highest_vol_id: highest volume ID 102 * @highest_vol_id: highest volume ID
104 * @is_empty: flag indicating whether the MTD device is empty or not 103 * @is_empty: flag indicating whether the MTD device is empty or not
@@ -119,13 +118,11 @@ struct ubi_scan_info {
119 struct list_head free; 118 struct list_head free;
120 struct list_head erase; 119 struct list_head erase;
121 struct list_head alien; 120 struct list_head alien;
122 int used_peb_count;
123 int corr_peb_count; 121 int corr_peb_count;
124 int read_err_count; 122 int empty_peb_count;
125 int free_peb_count;
126 int erase_peb_count;
127 int alien_peb_count; 123 int alien_peb_count;
128 int bad_peb_count; 124 int bad_peb_count;
125 int maybe_bad_peb_count;
129 int vols_found; 126 int vols_found;
130 int highest_vol_id; 127 int highest_vol_id;
131 int is_empty; 128 int is_empty;