aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>2012-05-16 23:23:22 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-20 13:26:01 -0400
commit227423d2416651abeafb5fd0c88c50eb0b99cb97 (patch)
treedd8ea55d4582573cfb3995b08f73e70f1adb8b19 /drivers/mtd/ubi
parent97d6104bac24c30258748e200065559cd53b4b02 (diff)
UBI: rename struct ubi_scan_leb
Rename 'struct ubi_scan_leb' to 'struct ubi_ainf_leb'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word and use "ainf" instead which stands for "attach information". It has the same length as "scan" so re-naming is trivial. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/build.c2
-rw-r--r--drivers/mtd/ubi/debug.c4
-rw-r--r--drivers/mtd/ubi/debug.h2
-rw-r--r--drivers/mtd/ubi/eba.c2
-rw-r--r--drivers/mtd/ubi/scan.c42
-rw-r--r--drivers/mtd/ubi/scan.h16
-rw-r--r--drivers/mtd/ubi/vtbl.c4
-rw-r--r--drivers/mtd/ubi/wl.c2
8 files changed, 37 insertions, 37 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 2d5728294a66..3d555975e482 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -937,7 +937,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
937 spin_lock_init(&ubi->volumes_lock); 937 spin_lock_init(&ubi->volumes_lock);
938 938
939 ubi_msg("attaching mtd%d to ubi%d", mtd->index, ubi_num); 939 ubi_msg("attaching mtd%d to ubi%d", mtd->index, ubi_num);
940 dbg_msg("sizeof(struct ubi_scan_leb) %zu", sizeof(struct ubi_scan_leb)); 940 dbg_msg("sizeof(struct ubi_ainf_peb) %zu", sizeof(struct ubi_ainf_peb));
941 dbg_msg("sizeof(struct ubi_wl_entry) %zu", sizeof(struct ubi_wl_entry)); 941 dbg_msg("sizeof(struct ubi_wl_entry) %zu", sizeof(struct ubi_wl_entry));
942 942
943 err = io_init(ubi); 943 err = io_init(ubi);
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index c6becde40314..a07ce2dcb968 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -188,11 +188,11 @@ void ubi_dump_sv(const struct ubi_scan_volume *sv)
188} 188}
189 189
190/** 190/**
191 * ubi_dump_seb - dump a &struct ubi_scan_leb object. 191 * ubi_dump_seb - dump a &struct ubi_ainf_peb object.
192 * @seb: the object to dump 192 * @seb: the object to dump
193 * @type: object type: 0 - not corrupted, 1 - corrupted 193 * @type: object type: 0 - not corrupted, 1 - corrupted
194 */ 194 */
195void ubi_dump_seb(const struct ubi_scan_leb *seb, int type) 195void ubi_dump_seb(const struct ubi_ainf_peb *seb, int type)
196{ 196{
197 printk(KERN_DEBUG "eraseblock scanning information dump:\n"); 197 printk(KERN_DEBUG "eraseblock scanning information dump:\n");
198 printk(KERN_DEBUG "\tec %d\n", seb->ec); 198 printk(KERN_DEBUG "\tec %d\n", seb->ec);
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index 4d0a4cdc9e3b..c6729ff0caa5 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -60,7 +60,7 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
60void ubi_dump_vol_info(const struct ubi_volume *vol); 60void ubi_dump_vol_info(const struct ubi_volume *vol);
61void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx); 61void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx);
62void ubi_dump_sv(const struct ubi_scan_volume *sv); 62void ubi_dump_sv(const struct ubi_scan_volume *sv);
63void ubi_dump_seb(const struct ubi_scan_leb *seb, int type); 63void ubi_dump_seb(const struct ubi_ainf_peb *seb, int type);
64void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req); 64void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req);
65int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, 65int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset,
66 int len); 66 int len);
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index bd5fdbf7cb41..ac0e0efba8a5 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -1217,7 +1217,7 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
1217 int i, j, err, num_volumes; 1217 int i, j, err, num_volumes;
1218 struct ubi_scan_volume *sv; 1218 struct ubi_scan_volume *sv;
1219 struct ubi_volume *vol; 1219 struct ubi_volume *vol;
1220 struct ubi_scan_leb *seb; 1220 struct ubi_ainf_peb *seb;
1221 struct rb_node *rb; 1221 struct rb_node *rb;
1222 1222
1223 dbg_eba("initialize EBA sub-system"); 1223 dbg_eba("initialize EBA sub-system");
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index dc7f9dba5cce..cddb60c5defe 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -29,7 +29,7 @@
29 * objects which are kept in volume RB-tree with root at the @volumes field. 29 * objects which are kept in volume RB-tree with root at the @volumes field.
30 * The RB-tree is indexed by the volume ID. 30 * The RB-tree is indexed by the volume ID.
31 * 31 *
32 * Scanned logical eraseblocks are represented by &struct ubi_scan_leb objects. 32 * Scanned logical eraseblocks are represented by &struct ubi_ainf_peb objects.
33 * These objects are kept in per-volume RB-trees with the root at the 33 * These objects are kept in per-volume RB-trees with the root at the
34 * corresponding &struct ubi_scan_volume object. To put it differently, we keep 34 * corresponding &struct ubi_scan_volume object. To put it differently, we keep
35 * an RB-tree of per-volume objects and each of these objects is the root of 35 * an RB-tree of per-volume objects and each of these objects is the root of
@@ -113,7 +113,7 @@ static struct ubi_vid_hdr *vidh;
113static int add_to_list(struct ubi_scan_info *si, int pnum, int ec, int to_head, 113static int add_to_list(struct ubi_scan_info *si, int pnum, int ec, int to_head,
114 struct list_head *list) 114 struct list_head *list)
115{ 115{
116 struct ubi_scan_leb *seb; 116 struct ubi_ainf_peb *seb;
117 117
118 if (list == &si->free) { 118 if (list == &si->free) {
119 dbg_bld("add to free: PEB %d, EC %d", pnum, ec); 119 dbg_bld("add to free: PEB %d, EC %d", pnum, ec);
@@ -150,7 +150,7 @@ static int add_to_list(struct ubi_scan_info *si, int pnum, int ec, int to_head,
150 */ 150 */
151static int add_corrupted(struct ubi_scan_info *si, int pnum, int ec) 151static int add_corrupted(struct ubi_scan_info *si, int pnum, int ec)
152{ 152{
153 struct ubi_scan_leb *seb; 153 struct ubi_ainf_peb *seb;
154 154
155 dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec); 155 dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec);
156 156
@@ -310,7 +310,7 @@ static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
310 * o bit 2 is cleared: the older LEB is not corrupted; 310 * o bit 2 is cleared: the older LEB is not corrupted;
311 * o bit 2 is set: the older LEB is corrupted. 311 * o bit 2 is set: the older LEB is corrupted.
312 */ 312 */
313static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb, 313static int compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *seb,
314 int pnum, const struct ubi_vid_hdr *vid_hdr) 314 int pnum, const struct ubi_vid_hdr *vid_hdr)
315{ 315{
316 void *buf; 316 void *buf;
@@ -447,7 +447,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
447 int err, vol_id, lnum; 447 int err, vol_id, lnum;
448 unsigned long long sqnum; 448 unsigned long long sqnum;
449 struct ubi_scan_volume *sv; 449 struct ubi_scan_volume *sv;
450 struct ubi_scan_leb *seb; 450 struct ubi_ainf_peb *seb;
451 struct rb_node **p, *parent = NULL; 451 struct rb_node **p, *parent = NULL;
452 452
453 vol_id = be32_to_cpu(vid_hdr->vol_id); 453 vol_id = be32_to_cpu(vid_hdr->vol_id);
@@ -473,7 +473,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
473 int cmp_res; 473 int cmp_res;
474 474
475 parent = *p; 475 parent = *p;
476 seb = rb_entry(parent, struct ubi_scan_leb, u.rb); 476 seb = rb_entry(parent, struct ubi_ainf_peb, u.rb);
477 if (lnum != seb->lnum) { 477 if (lnum != seb->lnum) {
478 if (lnum < seb->lnum) 478 if (lnum < seb->lnum)
479 p = &(*p)->rb_left; 479 p = &(*p)->rb_left;
@@ -622,14 +622,14 @@ struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
622 * This function returns a pointer to the scanning logical eraseblock or %NULL 622 * This function returns a pointer to the scanning logical eraseblock or %NULL
623 * if there are no data about it in the scanning volume information. 623 * if there are no data about it in the scanning volume information.
624 */ 624 */
625struct ubi_scan_leb *ubi_scan_find_seb(const struct ubi_scan_volume *sv, 625struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
626 int lnum) 626 int lnum)
627{ 627{
628 struct ubi_scan_leb *seb; 628 struct ubi_ainf_peb *seb;
629 struct rb_node *p = sv->root.rb_node; 629 struct rb_node *p = sv->root.rb_node;
630 630
631 while (p) { 631 while (p) {
632 seb = rb_entry(p, struct ubi_scan_leb, u.rb); 632 seb = rb_entry(p, struct ubi_ainf_peb, u.rb);
633 633
634 if (lnum == seb->lnum) 634 if (lnum == seb->lnum)
635 return seb; 635 return seb;
@@ -651,12 +651,12 @@ struct ubi_scan_leb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
651void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv) 651void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
652{ 652{
653 struct rb_node *rb; 653 struct rb_node *rb;
654 struct ubi_scan_leb *seb; 654 struct ubi_ainf_peb *seb;
655 655
656 dbg_bld("remove scanning information about volume %d", sv->vol_id); 656 dbg_bld("remove scanning information about volume %d", sv->vol_id);
657 657
658 while ((rb = rb_first(&sv->root))) { 658 while ((rb = rb_first(&sv->root))) {
659 seb = rb_entry(rb, struct ubi_scan_leb, u.rb); 659 seb = rb_entry(rb, struct ubi_ainf_peb, u.rb);
660 rb_erase(&seb->u.rb, &sv->root); 660 rb_erase(&seb->u.rb, &sv->root);
661 list_add_tail(&seb->u.list, &si->erase); 661 list_add_tail(&seb->u.list, &si->erase);
662 } 662 }
@@ -725,14 +725,14 @@ out_free:
725 * This function returns scanning physical eraseblock information in case of 725 * This function returns scanning physical eraseblock information in case of
726 * success and an error code in case of failure. 726 * success and an error code in case of failure.
727 */ 727 */
728struct ubi_scan_leb *ubi_scan_get_free_peb(struct ubi_device *ubi, 728struct ubi_ainf_peb *ubi_scan_get_free_peb(struct ubi_device *ubi,
729 struct ubi_scan_info *si) 729 struct ubi_scan_info *si)
730{ 730{
731 int err = 0; 731 int err = 0;
732 struct ubi_scan_leb *seb, *tmp_seb; 732 struct ubi_ainf_peb *seb, *tmp_seb;
733 733
734 if (!list_empty(&si->free)) { 734 if (!list_empty(&si->free)) {
735 seb = list_entry(si->free.next, struct ubi_scan_leb, u.list); 735 seb = list_entry(si->free.next, struct ubi_ainf_peb, u.list);
736 list_del(&seb->u.list); 736 list_del(&seb->u.list);
737 dbg_bld("return free PEB %d, EC %d", seb->pnum, seb->ec); 737 dbg_bld("return free PEB %d, EC %d", seb->pnum, seb->ec);
738 return seb; 738 return seb;
@@ -1075,7 +1075,7 @@ adjust_mean_ec:
1075 */ 1075 */
1076static int check_what_we_have(struct ubi_device *ubi, struct ubi_scan_info *si) 1076static int check_what_we_have(struct ubi_device *ubi, struct ubi_scan_info *si)
1077{ 1077{
1078 struct ubi_scan_leb *seb; 1078 struct ubi_ainf_peb *seb;
1079 int max_corr, peb_count; 1079 int max_corr, peb_count;
1080 1080
1081 peb_count = ubi->peb_count - si->bad_peb_count - si->alien_peb_count; 1081 peb_count = ubi->peb_count - si->bad_peb_count - si->alien_peb_count;
@@ -1148,7 +1148,7 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi)
1148 int err, pnum; 1148 int err, pnum;
1149 struct rb_node *rb1, *rb2; 1149 struct rb_node *rb1, *rb2;
1150 struct ubi_scan_volume *sv; 1150 struct ubi_scan_volume *sv;
1151 struct ubi_scan_leb *seb; 1151 struct ubi_ainf_peb *seb;
1152 struct ubi_scan_info *si; 1152 struct ubi_scan_info *si;
1153 1153
1154 si = kzalloc(sizeof(struct ubi_scan_info), GFP_KERNEL); 1154 si = kzalloc(sizeof(struct ubi_scan_info), GFP_KERNEL);
@@ -1163,7 +1163,7 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi)
1163 1163
1164 err = -ENOMEM; 1164 err = -ENOMEM;
1165 si->scan_leb_slab = kmem_cache_create("ubi_scan_leb_slab", 1165 si->scan_leb_slab = kmem_cache_create("ubi_scan_leb_slab",
1166 sizeof(struct ubi_scan_leb), 1166 sizeof(struct ubi_ainf_peb),
1167 0, 0, NULL); 1167 0, 0, NULL);
1168 if (!si->scan_leb_slab) 1168 if (!si->scan_leb_slab)
1169 goto out_si; 1169 goto out_si;
@@ -1246,7 +1246,7 @@ out_si:
1246 */ 1246 */
1247static void destroy_sv(struct ubi_scan_info *si, struct ubi_scan_volume *sv) 1247static void destroy_sv(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
1248{ 1248{
1249 struct ubi_scan_leb *seb; 1249 struct ubi_ainf_peb *seb;
1250 struct rb_node *this = sv->root.rb_node; 1250 struct rb_node *this = sv->root.rb_node;
1251 1251
1252 while (this) { 1252 while (this) {
@@ -1255,7 +1255,7 @@ static void destroy_sv(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
1255 else if (this->rb_right) 1255 else if (this->rb_right)
1256 this = this->rb_right; 1256 this = this->rb_right;
1257 else { 1257 else {
1258 seb = rb_entry(this, struct ubi_scan_leb, u.rb); 1258 seb = rb_entry(this, struct ubi_ainf_peb, u.rb);
1259 this = rb_parent(this); 1259 this = rb_parent(this);
1260 if (this) { 1260 if (this) {
1261 if (this->rb_left == &seb->u.rb) 1261 if (this->rb_left == &seb->u.rb)
@@ -1276,7 +1276,7 @@ static void destroy_sv(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
1276 */ 1276 */
1277void ubi_scan_destroy_si(struct ubi_scan_info *si) 1277void ubi_scan_destroy_si(struct ubi_scan_info *si)
1278{ 1278{
1279 struct ubi_scan_leb *seb, *seb_tmp; 1279 struct ubi_ainf_peb *seb, *seb_tmp;
1280 struct ubi_scan_volume *sv; 1280 struct ubi_scan_volume *sv;
1281 struct rb_node *rb; 1281 struct rb_node *rb;
1282 1282
@@ -1338,7 +1338,7 @@ static int self_check_si(struct ubi_device *ubi, struct ubi_scan_info *si)
1338 int pnum, err, vols_found = 0; 1338 int pnum, err, vols_found = 0;
1339 struct rb_node *rb1, *rb2; 1339 struct rb_node *rb1, *rb2;
1340 struct ubi_scan_volume *sv; 1340 struct ubi_scan_volume *sv;
1341 struct ubi_scan_leb *seb, *last_seb; 1341 struct ubi_ainf_peb *seb, *last_seb;
1342 uint8_t *buf; 1342 uint8_t *buf;
1343 1343
1344 if (!ubi->dbg->chk_gen) 1344 if (!ubi->dbg->chk_gen)
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h
index d48aef15ab5d..2cd66624dfa1 100644
--- a/drivers/mtd/ubi/scan.h
+++ b/drivers/mtd/ubi/scan.h
@@ -25,7 +25,7 @@
25#define UBI_SCAN_UNKNOWN_EC (-1) 25#define UBI_SCAN_UNKNOWN_EC (-1)
26 26
27/** 27/**
28 * struct ubi_scan_leb - scanning information about a physical eraseblock. 28 * struct ubi_ainf_peb - scanning information about a physical eraseblock.
29 * @ec: erase counter (%UBI_SCAN_UNKNOWN_EC if it is unknown) 29 * @ec: erase counter (%UBI_SCAN_UNKNOWN_EC if it is unknown)
30 * @pnum: physical eraseblock number 30 * @pnum: physical eraseblock number
31 * @lnum: logical eraseblock number 31 * @lnum: logical eraseblock number
@@ -33,13 +33,13 @@
33 * @copy_flag: this LEB is a copy (@copy_flag is set in VID header of this LEB) 33 * @copy_flag: this LEB is a copy (@copy_flag is set in VID header of this LEB)
34 * @sqnum: sequence number 34 * @sqnum: sequence number
35 * @u: unions RB-tree or @list links 35 * @u: unions RB-tree or @list links
36 * @u.rb: link in the per-volume RB-tree of &struct ubi_scan_leb objects 36 * @u.rb: link in the per-volume RB-tree of &struct ubi_ainf_peb objects
37 * @u.list: link in one of the eraseblock lists 37 * @u.list: link in one of the eraseblock lists
38 * 38 *
39 * One object of this type is allocated for each physical eraseblock during 39 * One object of this type is allocated for each physical eraseblock during
40 * scanning. 40 * scanning.
41 */ 41 */
42struct ubi_scan_leb { 42struct ubi_ainf_peb {
43 int ec; 43 int ec;
44 int pnum; 44 int pnum;
45 int lnum; 45 int lnum;
@@ -68,7 +68,7 @@ struct ubi_scan_leb {
68 * @compat: compatibility flags of this volume 68 * @compat: compatibility flags of this volume
69 * @rb: link in the volume RB-tree 69 * @rb: link in the volume RB-tree
70 * @root: root of the RB-tree containing all the eraseblock belonging to this 70 * @root: root of the RB-tree containing all the eraseblock belonging to this
71 * volume (&struct ubi_scan_leb objects) 71 * volume (&struct ubi_ainf_peb objects)
72 * 72 *
73 * One object of this type is allocated for each volume during scanning. 73 * One object of this type is allocated for each volume during scanning.
74 */ 74 */
@@ -109,7 +109,7 @@ struct ubi_scan_volume {
109 * @mean_ec: mean erase counter value 109 * @mean_ec: mean erase counter value
110 * @ec_sum: a temporary variable used when calculating @mean_ec 110 * @ec_sum: a temporary variable used when calculating @mean_ec
111 * @ec_count: a temporary variable used when calculating @mean_ec 111 * @ec_count: a temporary variable used when calculating @mean_ec
112 * @scan_leb_slab: slab cache for &struct ubi_scan_leb objects 112 * @scan_leb_slab: slab cache for &struct ubi_ainf_peb objects
113 * 113 *
114 * This data structure contains the result of scanning and may be used by other 114 * This data structure contains the result of scanning and may be used by other
115 * UBI sub-systems to build final UBI data structures, further error-recovery 115 * UBI sub-systems to build final UBI data structures, further error-recovery
@@ -149,7 +149,7 @@ struct ubi_vid_hdr;
149 * @list: the list to move to 149 * @list: the list to move to
150 */ 150 */
151static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv, 151static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv,
152 struct ubi_scan_leb *seb, 152 struct ubi_ainf_peb *seb,
153 struct list_head *list) 153 struct list_head *list)
154{ 154{
155 rb_erase(&seb->u.rb, &sv->root); 155 rb_erase(&seb->u.rb, &sv->root);
@@ -161,10 +161,10 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
161 int bitflips); 161 int bitflips);
162struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si, 162struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
163 int vol_id); 163 int vol_id);
164struct ubi_scan_leb *ubi_scan_find_seb(const struct ubi_scan_volume *sv, 164struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
165 int lnum); 165 int lnum);
166void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv); 166void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv);
167struct ubi_scan_leb *ubi_scan_get_free_peb(struct ubi_device *ubi, 167struct ubi_ainf_peb *ubi_scan_get_free_peb(struct ubi_device *ubi,
168 struct ubi_scan_info *si); 168 struct ubi_scan_info *si);
169int ubi_scan_erase_peb(struct ubi_device *ubi, const struct ubi_scan_info *si, 169int ubi_scan_erase_peb(struct ubi_device *ubi, const struct ubi_scan_info *si,
170 int pnum, int ec); 170 int pnum, int ec);
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index f3fbaa9ec7f2..c9b828a69609 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -303,7 +303,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si,
303{ 303{
304 int err, tries = 0; 304 int err, tries = 0;
305 struct ubi_vid_hdr *vid_hdr; 305 struct ubi_vid_hdr *vid_hdr;
306 struct ubi_scan_leb *new_seb; 306 struct ubi_ainf_peb *new_seb;
307 307
308 ubi_msg("create volume table (copy #%d)", copy + 1); 308 ubi_msg("create volume table (copy #%d)", copy + 1);
309 309
@@ -378,7 +378,7 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
378{ 378{
379 int err; 379 int err;
380 struct rb_node *rb; 380 struct rb_node *rb;
381 struct ubi_scan_leb *seb; 381 struct ubi_ainf_peb *seb;
382 struct ubi_vtbl_record *leb[UBI_LAYOUT_VOLUME_EBS] = { NULL, NULL }; 382 struct ubi_vtbl_record *leb[UBI_LAYOUT_VOLUME_EBS] = { NULL, NULL };
383 int leb_corrupted[UBI_LAYOUT_VOLUME_EBS] = {1, 1}; 383 int leb_corrupted[UBI_LAYOUT_VOLUME_EBS] = {1, 1};
384 384
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index b847f5529ba6..91869e8d2a90 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -1385,7 +1385,7 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
1385 int err, i; 1385 int err, i;
1386 struct rb_node *rb1, *rb2; 1386 struct rb_node *rb1, *rb2;
1387 struct ubi_scan_volume *sv; 1387 struct ubi_scan_volume *sv;
1388 struct ubi_scan_leb *seb, *tmp; 1388 struct ubi_ainf_peb *seb, *tmp;
1389 struct ubi_wl_entry *e; 1389 struct ubi_wl_entry *e;
1390 1390
1391 ubi->used = ubi->erroneous = ubi->free = ubi->scrub = RB_ROOT; 1391 ubi->used = ubi->erroneous = ubi->free = ubi->scrub = RB_ROOT;