Commit 2c5ec5ce authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by 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: default avatarArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
parent 55e93e55
......@@ -188,19 +188,19 @@ void ubi_dump_sv(const struct ubi_ainf_volume *sv)
}
/**
* ubi_dump_seb - dump a &struct ubi_ainf_peb object.
* @seb: the object to dump
* ubi_dump_aeb - dump a &struct ubi_ainf_peb object.
* @aeb: the object to dump
* @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 "\tec %d\n", seb->ec);
printk(KERN_DEBUG "\tpnum %d\n", seb->pnum);
printk(KERN_DEBUG "\tec %d\n", aeb->ec);
printk(KERN_DEBUG "\tpnum %d\n", aeb->pnum);
if (type == 0) {
printk(KERN_DEBUG "\tlnum %d\n", seb->lnum);
printk(KERN_DEBUG "\tscrub %d\n", seb->scrub);
printk(KERN_DEBUG "\tsqnum %llu\n", seb->sqnum);
printk(KERN_DEBUG "\tlnum %d\n", aeb->lnum);
printk(KERN_DEBUG "\tscrub %d\n", aeb->scrub);
printk(KERN_DEBUG "\tsqnum %llu\n", aeb->sqnum);
}
}
......
......@@ -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_vtbl_record(const struct ubi_vtbl_record *r, int idx);
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);
int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset,
int len);
......
......@@ -1217,7 +1217,7 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
int i, j, err, num_volumes;
struct ubi_ainf_volume *sv;
struct ubi_volume *vol;
struct ubi_ainf_peb *seb;
struct ubi_ainf_peb *aeb;
struct rb_node *rb;
dbg_eba("initialize EBA sub-system");
......@@ -1250,14 +1250,14 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
if (!sv)
continue;
ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) {
if (seb->lnum >= vol->reserved_pebs)
ubi_rb_for_each_entry(rb, aeb, &sv->root, u.rb) {
if (aeb->lnum >= vol->reserved_pebs)
/*
* This may happen in case of an unclean reboot
* during re-size.
*/
ubi_scan_move_to_list(sv, seb, &si->erase);
vol->eba_tbl[seb->lnum] = seb->pnum;
ubi_scan_move_to_list(sv, aeb, &si->erase);
vol->eba_tbl[aeb->lnum] = aeb->pnum;
}
}
......
This diff is collapsed.
......@@ -146,15 +146,15 @@ struct ubi_vid_hdr;
* ubi_scan_move_to_list - move a PEB from the volume tree to a list.
*
* @sv: volume scanning information
* @seb: scanning eraseblock information
* @aeb: scanning eraseblock information
* @list: the list to move to
*/
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)
{
rb_erase(&seb->u.rb, &sv->root);
list_add_tail(&seb->u.list, list);
rb_erase(&aeb->u.rb, &sv->root);
list_add_tail(&aeb->u.list, list);
}
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);
struct ubi_ainf_volume *ubi_scan_find_sv(const struct ubi_attach_info *si,
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);
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,
......
......@@ -303,7 +303,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si,
{
int err, tries = 0;
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);
......@@ -312,9 +312,9 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *si,
return -ENOMEM;
retry:
new_seb = ubi_scan_get_free_peb(ubi, si);
if (IS_ERR(new_seb)) {
err = PTR_ERR(new_seb);
new_aeb = ubi_scan_get_free_peb(ubi, si);
if (IS_ERR(new_aeb)) {
err = PTR_ERR(new_aeb);
goto out_free;
}
......@@ -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);
/* 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)
goto write_error;
/* 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)
goto write_error;
......@@ -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
* 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);
kfree(new_seb);
kfree(new_aeb);
ubi_free_vid_hdr(ubi, vid_hdr);
return err;
......@@ -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
* another one.
*/
list_add(&new_seb->u.list, &si->erase);
list_add(&new_aeb->u.list, &si->erase);
goto retry;
}
kfree(new_seb);
kfree(new_aeb);
out_free:
ubi_free_vid_hdr(ubi, vid_hdr);
return err;
......@@ -378,7 +378,7 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
{
int err;
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 };
int leb_corrupted[UBI_LAYOUT_VOLUME_EBS] = {1, 1};
......@@ -410,14 +410,14 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
dbg_gen("check layout volume");
/* Read both LEB 0 and LEB 1 into memory */
ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) {
leb[seb->lnum] = vzalloc(ubi->vtbl_size);
if (!leb[seb->lnum]) {
ubi_rb_for_each_entry(rb, aeb, &sv->root, u.rb) {
leb[aeb->lnum] = vzalloc(ubi->vtbl_size);
if (!leb[aeb->lnum]) {
err = -ENOMEM;
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);
if (err == UBI_IO_BITFLIPS || mtd_is_eccerr(err))
/*
......@@ -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
* the data will be checked later. If the data is OK,
* 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
* seb->scrub will be cleared in
* aeb->scrub will be cleared in
* 'ubi_scan_add_used()'.
*/
seb->scrub = 1;
aeb->scrub = 1;
else if (err)
goto out_free;
}
......
......@@ -1385,7 +1385,7 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_attach_info *si)
int err, i;
struct rb_node *rb1, *rb2;
struct ubi_ainf_volume *sv;
struct ubi_ainf_peb *seb, *tmp;
struct ubi_ainf_peb *aeb, *tmp;
struct ubi_wl_entry *e;
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)
INIT_LIST_HEAD(&ubi->pq[i]);
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();
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
if (!e)
goto out_free;
e->pnum = seb->pnum;
e->ec = seb->ec;
e->pnum = aeb->pnum;
e->ec = aeb->ec;
ubi->lookuptbl[e->pnum] = e;
if (schedule_erase(ubi, e, 0)) {
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)
}
}
list_for_each_entry(seb, &si->free, u.list) {
list_for_each_entry(aeb, &si->free, u.list) {
cond_resched();
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
if (!e)
goto out_free;
e->pnum = seb->pnum;
e->ec = seb->ec;
e->pnum = aeb->pnum;
e->ec = aeb->ec;
ubi_assert(e->ec >= 0);
wl_tree_add(e, &ubi->free);
ubi->lookuptbl[e->pnum] = e;
}
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();
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
if (!e)
goto out_free;
e->pnum = seb->pnum;
e->ec = seb->ec;
e->pnum = aeb->pnum;
e->ec = aeb->ec;
ubi->lookuptbl[e->pnum] = e;
if (!seb->scrub) {
if (!aeb->scrub) {
dbg_wl("add PEB %d EC %d to the used tree",
e->pnum, e->ec);
wl_tree_add(e, &ubi->used);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment