提交 2c5ec5ce 编写于 作者: A Artem Bityutskiy 提交者: Artem Bityutskiy

UBI: rename seb to aeb

After re-naming the 'struct ubi_scan_leb' we should adjust all variables
named 'seb' to something else, because 'seb' stands for "scanning eraseblock".
Let's rename it to 'aeb' which stands for "attaching eraseblock" which is
a bit more consistend and has the same length.
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
上级 55e93e55
...@@ -188,19 +188,19 @@ void ubi_dump_sv(const struct ubi_ainf_volume *sv) ...@@ -188,19 +188,19 @@ void ubi_dump_sv(const struct ubi_ainf_volume *sv)
} }
/** /**
* ubi_dump_seb - dump a &struct ubi_ainf_peb object. * ubi_dump_aeb - dump a &struct ubi_ainf_peb object.
* @seb: the object to dump * @aeb: the object to dump
* @type: object type: 0 - not corrupted, 1 - corrupted * @type: object type: 0 - not corrupted, 1 - corrupted
*/ */
void ubi_dump_seb(const struct ubi_ainf_peb *seb, int type) void ubi_dump_aeb(const struct ubi_ainf_peb *aeb, int type)
{ {
printk(KERN_DEBUG "eraseblock scanning information dump:\n"); printk(KERN_DEBUG "eraseblock scanning information dump:\n");
printk(KERN_DEBUG "\tec %d\n", seb->ec); printk(KERN_DEBUG "\tec %d\n", aeb->ec);
printk(KERN_DEBUG "\tpnum %d\n", seb->pnum); printk(KERN_DEBUG "\tpnum %d\n", aeb->pnum);
if (type == 0) { if (type == 0) {
printk(KERN_DEBUG "\tlnum %d\n", seb->lnum); printk(KERN_DEBUG "\tlnum %d\n", aeb->lnum);
printk(KERN_DEBUG "\tscrub %d\n", seb->scrub); printk(KERN_DEBUG "\tscrub %d\n", aeb->scrub);
printk(KERN_DEBUG "\tsqnum %llu\n", seb->sqnum); printk(KERN_DEBUG "\tsqnum %llu\n", aeb->sqnum);
} }
} }
......
...@@ -60,7 +60,7 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); ...@@ -60,7 +60,7 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
void ubi_dump_vol_info(const struct ubi_volume *vol); void ubi_dump_vol_info(const struct ubi_volume *vol);
void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx); void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx);
void ubi_dump_sv(const struct ubi_ainf_volume *sv); void ubi_dump_sv(const struct ubi_ainf_volume *sv);
void ubi_dump_seb(const struct ubi_ainf_peb *seb, int type); void ubi_dump_aeb(const struct ubi_ainf_peb *aeb, int type);
void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req); void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req);
int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset,
int len); int len);
......
...@@ -1217,7 +1217,7 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si) ...@@ -1217,7 +1217,7 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
int i, j, err, num_volumes; int i, j, err, num_volumes;
struct ubi_ainf_volume *sv; struct ubi_ainf_volume *sv;
struct ubi_volume *vol; struct ubi_volume *vol;
struct ubi_ainf_peb *seb; struct ubi_ainf_peb *aeb;
struct rb_node *rb; struct rb_node *rb;
dbg_eba("initialize EBA sub-system"); dbg_eba("initialize EBA sub-system");
...@@ -1250,14 +1250,14 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si) ...@@ -1250,14 +1250,14 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
if (!sv) if (!sv)
continue; continue;
ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) { ubi_rb_for_each_entry(rb, aeb, &sv->root, u.rb) {
if (seb->lnum >= vol->reserved_pebs) if (aeb->lnum >= vol->reserved_pebs)
/* /*
* This may happen in case of an unclean reboot * This may happen in case of an unclean reboot
* during re-size. * during re-size.
*/ */
ubi_scan_move_to_list(sv, seb, &si->erase); ubi_scan_move_to_list(sv, aeb, &si->erase);
vol->eba_tbl[seb->lnum] = seb->pnum; vol->eba_tbl[aeb->lnum] = aeb->pnum;
} }
} }
......
此差异已折叠。
...@@ -146,15 +146,15 @@ struct ubi_vid_hdr; ...@@ -146,15 +146,15 @@ struct ubi_vid_hdr;
* ubi_scan_move_to_list - move a PEB from the volume tree to a list. * ubi_scan_move_to_list - move a PEB from the volume tree to a list.
* *
* @sv: volume scanning information * @sv: volume scanning information
* @seb: scanning eraseblock information * @aeb: scanning eraseblock information
* @list: the list to move to * @list: the list to move to
*/ */
static inline void ubi_scan_move_to_list(struct ubi_ainf_volume *sv, static inline void ubi_scan_move_to_list(struct ubi_ainf_volume *sv,
struct ubi_ainf_peb *seb, struct ubi_ainf_peb *aeb,
struct list_head *list) struct list_head *list)
{ {
rb_erase(&seb->u.rb, &sv->root); rb_erase(&aeb->u.rb, &sv->root);
list_add_tail(&seb->u.list, list); list_add_tail(&aeb->u.list, list);
} }
int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_attach_info *si, int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_attach_info *si,
...@@ -162,7 +162,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_attach_info *si, ...@@ -162,7 +162,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_attach_info *si,
int bitflips); int bitflips);
struct ubi_ainf_volume *ubi_scan_find_sv(const struct ubi_attach_info *si, struct ubi_ainf_volume *ubi_scan_find_sv(const struct ubi_attach_info *si,
int vol_id); int vol_id);
struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_ainf_volume *sv, struct ubi_ainf_peb *ubi_scan_find_aeb(const struct ubi_ainf_volume *sv,
int lnum); int lnum);
void ubi_scan_rm_volume(struct ubi_attach_info *si, struct ubi_ainf_volume *sv); void ubi_scan_rm_volume(struct ubi_attach_info *si, struct ubi_ainf_volume *sv);
struct ubi_ainf_peb *ubi_scan_get_free_peb(struct ubi_device *ubi, struct ubi_ainf_peb *ubi_scan_get_free_peb(struct ubi_device *ubi,
......
...@@ -303,7 +303,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si, ...@@ -303,7 +303,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si,
{ {
int err, tries = 0; int err, tries = 0;
struct ubi_vid_hdr *vid_hdr; struct ubi_vid_hdr *vid_hdr;
struct ubi_ainf_peb *new_seb; struct ubi_ainf_peb *new_aeb;
ubi_msg("create volume table (copy #%d)", copy + 1); ubi_msg("create volume table (copy #%d)", copy + 1);
...@@ -312,9 +312,9 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si, ...@@ -312,9 +312,9 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si,
return -ENOMEM; return -ENOMEM;
retry: retry:
new_seb = ubi_scan_get_free_peb(ubi, si); new_aeb = ubi_scan_get_free_peb(ubi, si);
if (IS_ERR(new_seb)) { if (IS_ERR(new_aeb)) {
err = PTR_ERR(new_seb); err = PTR_ERR(new_aeb);
goto out_free; goto out_free;
} }
...@@ -327,12 +327,12 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si, ...@@ -327,12 +327,12 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si,
vid_hdr->sqnum = cpu_to_be64(++si->max_sqnum); vid_hdr->sqnum = cpu_to_be64(++si->max_sqnum);
/* The EC header is already there, write the VID header */ /* The EC header is already there, write the VID header */
err = ubi_io_write_vid_hdr(ubi, new_seb->pnum, vid_hdr); err = ubi_io_write_vid_hdr(ubi, new_aeb->pnum, vid_hdr);
if (err) if (err)
goto write_error; goto write_error;
/* Write the layout volume contents */ /* Write the layout volume contents */
err = ubi_io_write_data(ubi, vtbl, new_seb->pnum, 0, ubi->vtbl_size); err = ubi_io_write_data(ubi, vtbl, new_aeb->pnum, 0, ubi->vtbl_size);
if (err) if (err)
goto write_error; goto write_error;
...@@ -340,9 +340,9 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si, ...@@ -340,9 +340,9 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si,
* And add it to the scanning information. Don't delete the old version * And add it to the scanning information. Don't delete the old version
* of this LEB as it will be deleted and freed in 'ubi_scan_add_used()'. * of this LEB as it will be deleted and freed in 'ubi_scan_add_used()'.
*/ */
err = ubi_scan_add_used(ubi, si, new_seb->pnum, new_seb->ec, err = ubi_scan_add_used(ubi, si, new_aeb->pnum, new_aeb->ec,
vid_hdr, 0); vid_hdr, 0);
kfree(new_seb); kfree(new_aeb);
ubi_free_vid_hdr(ubi, vid_hdr); ubi_free_vid_hdr(ubi, vid_hdr);
return err; return err;
...@@ -352,10 +352,10 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si, ...@@ -352,10 +352,10 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si,
* Probably this physical eraseblock went bad, try to pick * Probably this physical eraseblock went bad, try to pick
* another one. * another one.
*/ */
list_add(&new_seb->u.list, &si->erase); list_add(&new_aeb->u.list, &si->erase);
goto retry; goto retry;
} }
kfree(new_seb); kfree(new_aeb);
out_free: out_free:
ubi_free_vid_hdr(ubi, vid_hdr); ubi_free_vid_hdr(ubi, vid_hdr);
return err; return err;
...@@ -378,7 +378,7 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi, ...@@ -378,7 +378,7 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
{ {
int err; int err;
struct rb_node *rb; struct rb_node *rb;
struct ubi_ainf_peb *seb; struct ubi_ainf_peb *aeb;
struct ubi_vtbl_record *leb[UBI_LAYOUT_VOLUME_EBS] = { NULL, NULL }; struct ubi_vtbl_record *leb[UBI_LAYOUT_VOLUME_EBS] = { NULL, NULL };
int leb_corrupted[UBI_LAYOUT_VOLUME_EBS] = {1, 1}; int leb_corrupted[UBI_LAYOUT_VOLUME_EBS] = {1, 1};
...@@ -410,14 +410,14 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi, ...@@ -410,14 +410,14 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
dbg_gen("check layout volume"); dbg_gen("check layout volume");
/* Read both LEB 0 and LEB 1 into memory */ /* Read both LEB 0 and LEB 1 into memory */
ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) { ubi_rb_for_each_entry(rb, aeb, &sv->root, u.rb) {
leb[seb->lnum] = vzalloc(ubi->vtbl_size); leb[aeb->lnum] = vzalloc(ubi->vtbl_size);
if (!leb[seb->lnum]) { if (!leb[aeb->lnum]) {
err = -ENOMEM; err = -ENOMEM;
goto out_free; goto out_free;
} }
err = ubi_io_read_data(ubi, leb[seb->lnum], seb->pnum, 0, err = ubi_io_read_data(ubi, leb[aeb->lnum], aeb->pnum, 0,
ubi->vtbl_size); ubi->vtbl_size);
if (err == UBI_IO_BITFLIPS || mtd_is_eccerr(err)) if (err == UBI_IO_BITFLIPS || mtd_is_eccerr(err))
/* /*
...@@ -425,12 +425,12 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi, ...@@ -425,12 +425,12 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
* uncorrectable ECC error, but we have our own CRC and * uncorrectable ECC error, but we have our own CRC and
* the data will be checked later. If the data is OK, * the data will be checked later. If the data is OK,
* the PEB will be scrubbed (because we set * the PEB will be scrubbed (because we set
* seb->scrub). If the data is not OK, the contents of * aeb->scrub). If the data is not OK, the contents of
* the PEB will be recovered from the second copy, and * the PEB will be recovered from the second copy, and
* seb->scrub will be cleared in * aeb->scrub will be cleared in
* 'ubi_scan_add_used()'. * 'ubi_scan_add_used()'.
*/ */
seb->scrub = 1; aeb->scrub = 1;
else if (err) else if (err)
goto out_free; goto out_free;
} }
......
...@@ -1385,7 +1385,7 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si) ...@@ -1385,7 +1385,7 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
int err, i; int err, i;
struct rb_node *rb1, *rb2; struct rb_node *rb1, *rb2;
struct ubi_ainf_volume *sv; struct ubi_ainf_volume *sv;
struct ubi_ainf_peb *seb, *tmp; struct ubi_ainf_peb *aeb, *tmp;
struct ubi_wl_entry *e; struct ubi_wl_entry *e;
ubi->used = ubi->erroneous = ubi->free = ubi->scrub = RB_ROOT; ubi->used = ubi->erroneous = ubi->free = ubi->scrub = RB_ROOT;
...@@ -1406,15 +1406,15 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si) ...@@ -1406,15 +1406,15 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
INIT_LIST_HEAD(&ubi->pq[i]); INIT_LIST_HEAD(&ubi->pq[i]);
ubi->pq_head = 0; ubi->pq_head = 0;
list_for_each_entry_safe(seb, tmp, &si->erase, u.list) { list_for_each_entry_safe(aeb, tmp, &si->erase, u.list) {
cond_resched(); cond_resched();
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL); e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
if (!e) if (!e)
goto out_free; goto out_free;
e->pnum = seb->pnum; e->pnum = aeb->pnum;
e->ec = seb->ec; e->ec = aeb->ec;
ubi->lookuptbl[e->pnum] = e; ubi->lookuptbl[e->pnum] = e;
if (schedule_erase(ubi, e, 0)) { if (schedule_erase(ubi, e, 0)) {
kmem_cache_free(ubi_wl_entry_slab, e); kmem_cache_free(ubi_wl_entry_slab, e);
...@@ -1422,32 +1422,32 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si) ...@@ -1422,32 +1422,32 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
} }
} }
list_for_each_entry(seb, &si->free, u.list) { list_for_each_entry(aeb, &si->free, u.list) {
cond_resched(); cond_resched();
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL); e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
if (!e) if (!e)
goto out_free; goto out_free;
e->pnum = seb->pnum; e->pnum = aeb->pnum;
e->ec = seb->ec; e->ec = aeb->ec;
ubi_assert(e->ec >= 0); ubi_assert(e->ec >= 0);
wl_tree_add(e, &ubi->free); wl_tree_add(e, &ubi->free);
ubi->lookuptbl[e->pnum] = e; ubi->lookuptbl[e->pnum] = e;
} }
ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) { ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) {
ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb) { ubi_rb_for_each_entry(rb2, aeb, &sv->root, u.rb) {
cond_resched(); cond_resched();
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL); e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
if (!e) if (!e)
goto out_free; goto out_free;
e->pnum = seb->pnum; e->pnum = aeb->pnum;
e->ec = seb->ec; e->ec = aeb->ec;
ubi->lookuptbl[e->pnum] = e; ubi->lookuptbl[e->pnum] = e;
if (!seb->scrub) { if (!aeb->scrub) {
dbg_wl("add PEB %d EC %d to the used tree", dbg_wl("add PEB %d EC %d to the used tree",
e->pnum, e->ec); e->pnum, e->ec);
wl_tree_add(e, &ubi->used); wl_tree_add(e, &ubi->used);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册