diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-04-30 05:31:26 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-06-04 04:30:43 -0400 |
commit | 33789fb9d4470e27d18596c0966339e2ca8865a9 (patch) | |
tree | 82b5025c7e0b40289977f1ccc9173c1702a4b036 /drivers/mtd/ubi/scan.h | |
parent | eb89580e1a8388d206bf143c6c39d001095106ba (diff) |
UBI: introduce eraseblock counter variables
This is just a preparation patch which introduces several
'struct ubi_scan_info' fields which count eraseblocks of different
types. This will be used later on to decide whether it is safe to
format the flash or not. No functional changes so far.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reviewed-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Tested-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Diffstat (limited to 'drivers/mtd/ubi/scan.h')
-rw-r--r-- | drivers/mtd/ubi/scan.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h index ff179ad7ca55..2576a8d1532b 100644 --- a/drivers/mtd/ubi/scan.h +++ b/drivers/mtd/ubi/scan.h | |||
@@ -91,10 +91,16 @@ 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 | ||
96 | * @read_err_count: count of PEBs read with error (%UBI_IO_BAD_HDR_READ was | ||
97 | * returned) | ||
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 | ||
94 | * @bad_peb_count: count of bad physical eraseblocks | 101 | * @bad_peb_count: count of bad physical eraseblocks |
95 | * @vols_found: number of volumes found during scanning | 102 | * @vols_found: number of volumes found during scanning |
96 | * @highest_vol_id: highest volume ID | 103 | * @highest_vol_id: highest volume ID |
97 | * @alien_peb_count: count of physical eraseblocks in the @alien list | ||
98 | * @is_empty: flag indicating whether the MTD device is empty or not | 104 | * @is_empty: flag indicating whether the MTD device is empty or not |
99 | * @min_ec: lowest erase counter value | 105 | * @min_ec: lowest erase counter value |
100 | * @max_ec: highest erase counter value | 106 | * @max_ec: highest erase counter value |
@@ -102,7 +108,6 @@ struct ubi_scan_volume { | |||
102 | * @mean_ec: mean erase counter value | 108 | * @mean_ec: mean erase counter value |
103 | * @ec_sum: a temporary variable used when calculating @mean_ec | 109 | * @ec_sum: a temporary variable used when calculating @mean_ec |
104 | * @ec_count: a temporary variable used when calculating @mean_ec | 110 | * @ec_count: a temporary variable used when calculating @mean_ec |
105 | * @corr_count: count of corrupted PEBs | ||
106 | * | 111 | * |
107 | * This data structure contains the result of scanning and may be used by other | 112 | * This data structure contains the result of scanning and may be used by other |
108 | * UBI sub-systems to build final UBI data structures, further error-recovery | 113 | * UBI sub-systems to build final UBI data structures, further error-recovery |
@@ -114,10 +119,15 @@ struct ubi_scan_info { | |||
114 | struct list_head free; | 119 | struct list_head free; |
115 | struct list_head erase; | 120 | struct list_head erase; |
116 | struct list_head alien; | 121 | struct list_head alien; |
122 | int used_peb_count; | ||
123 | int corr_peb_count; | ||
124 | int read_err_count; | ||
125 | int free_peb_count; | ||
126 | int erase_peb_count; | ||
127 | int alien_peb_count; | ||
117 | int bad_peb_count; | 128 | int bad_peb_count; |
118 | int vols_found; | 129 | int vols_found; |
119 | int highest_vol_id; | 130 | int highest_vol_id; |
120 | int alien_peb_count; | ||
121 | int is_empty; | 131 | int is_empty; |
122 | int min_ec; | 132 | int min_ec; |
123 | int max_ec; | 133 | int max_ec; |
@@ -125,7 +135,6 @@ struct ubi_scan_info { | |||
125 | int mean_ec; | 135 | int mean_ec; |
126 | uint64_t ec_sum; | 136 | uint64_t ec_sum; |
127 | int ec_count; | 137 | int ec_count; |
128 | int corr_count; | ||
129 | }; | 138 | }; |
130 | 139 | ||
131 | struct ubi_device; | 140 | struct ubi_device; |
@@ -135,7 +144,7 @@ struct ubi_vid_hdr; | |||
135 | * ubi_scan_move_to_list - move a PEB from the volume tree to a list. | 144 | * ubi_scan_move_to_list - move a PEB from the volume tree to a list. |
136 | * | 145 | * |
137 | * @sv: volume scanning information | 146 | * @sv: volume scanning information |
138 | * @seb: scanning eraseblock infprmation | 147 | * @seb: scanning eraseblock information |
139 | * @list: the list to move to | 148 | * @list: the list to move to |
140 | */ | 149 | */ |
141 | static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv, | 150 | static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv, |