Commit 1fc2e3e5 authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBI: rename ubi_scan_leb_slab

The old name is not logical anymore - rename it to 'aeb_slab_cache'.
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 0bae2887
...@@ -125,7 +125,7 @@ static int add_to_list(struct ubi_attach_info *ai, int pnum, int ec, ...@@ -125,7 +125,7 @@ static int add_to_list(struct ubi_attach_info *ai, int pnum, int ec,
} else } else
BUG(); BUG();
aeb = kmem_cache_alloc(ai->scan_leb_slab, GFP_KERNEL); aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL);
if (!aeb) if (!aeb)
return -ENOMEM; return -ENOMEM;
...@@ -154,7 +154,7 @@ static int add_corrupted(struct ubi_attach_info *ai, int pnum, int ec) ...@@ -154,7 +154,7 @@ static int add_corrupted(struct ubi_attach_info *ai, int pnum, int ec)
dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec); dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec);
aeb = kmem_cache_alloc(ai->scan_leb_slab, GFP_KERNEL); aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL);
if (!aeb) if (!aeb)
return -ENOMEM; return -ENOMEM;
...@@ -562,7 +562,7 @@ int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum, ...@@ -562,7 +562,7 @@ int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum,
if (err) if (err)
return err; return err;
aeb = kmem_cache_alloc(ai->scan_leb_slab, GFP_KERNEL); aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL);
if (!aeb) if (!aeb)
return -ENOMEM; return -ENOMEM;
...@@ -1133,10 +1133,10 @@ struct ubi_attach_info *ubi_scan(struct ubi_device *ubi) ...@@ -1133,10 +1133,10 @@ struct ubi_attach_info *ubi_scan(struct ubi_device *ubi)
ai->volumes = RB_ROOT; ai->volumes = RB_ROOT;
err = -ENOMEM; err = -ENOMEM;
ai->scan_leb_slab = kmem_cache_create("ubi_scan_leb_slab", ai->aeb_slab_cache = kmem_cache_create("ubi_aeb_slab_cache",
sizeof(struct ubi_ainf_peb), sizeof(struct ubi_ainf_peb),
0, 0, NULL); 0, 0, NULL);
if (!ai->scan_leb_slab) if (!ai->aeb_slab_cache)
goto out_ai; goto out_ai;
ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL);
...@@ -1235,7 +1235,7 @@ static void destroy_av(struct ubi_attach_info *ai, struct ubi_ainf_volume *av) ...@@ -1235,7 +1235,7 @@ static void destroy_av(struct ubi_attach_info *ai, struct ubi_ainf_volume *av)
this->rb_right = NULL; this->rb_right = NULL;
} }
kmem_cache_free(ai->scan_leb_slab, aeb); kmem_cache_free(ai->aeb_slab_cache, aeb);
} }
} }
kfree(av); kfree(av);
...@@ -1253,19 +1253,19 @@ void ubi_destroy_ai(struct ubi_attach_info *ai) ...@@ -1253,19 +1253,19 @@ void ubi_destroy_ai(struct ubi_attach_info *ai)
list_for_each_entry_safe(aeb, aeb_tmp, &ai->alien, u.list) { list_for_each_entry_safe(aeb, aeb_tmp, &ai->alien, u.list) {
list_del(&aeb->u.list); list_del(&aeb->u.list);
kmem_cache_free(ai->scan_leb_slab, aeb); kmem_cache_free(ai->aeb_slab_cache, aeb);
} }
list_for_each_entry_safe(aeb, aeb_tmp, &ai->erase, u.list) { list_for_each_entry_safe(aeb, aeb_tmp, &ai->erase, u.list) {
list_del(&aeb->u.list); list_del(&aeb->u.list);
kmem_cache_free(ai->scan_leb_slab, aeb); kmem_cache_free(ai->aeb_slab_cache, aeb);
} }
list_for_each_entry_safe(aeb, aeb_tmp, &ai->corr, u.list) { list_for_each_entry_safe(aeb, aeb_tmp, &ai->corr, u.list) {
list_del(&aeb->u.list); list_del(&aeb->u.list);
kmem_cache_free(ai->scan_leb_slab, aeb); kmem_cache_free(ai->aeb_slab_cache, aeb);
} }
list_for_each_entry_safe(aeb, aeb_tmp, &ai->free, u.list) { list_for_each_entry_safe(aeb, aeb_tmp, &ai->free, u.list) {
list_del(&aeb->u.list); list_del(&aeb->u.list);
kmem_cache_free(ai->scan_leb_slab, aeb); kmem_cache_free(ai->aeb_slab_cache, aeb);
} }
/* Destroy the volume RB-tree */ /* Destroy the volume RB-tree */
...@@ -1290,8 +1290,8 @@ void ubi_destroy_ai(struct ubi_attach_info *ai) ...@@ -1290,8 +1290,8 @@ void ubi_destroy_ai(struct ubi_attach_info *ai)
} }
} }
if (ai->scan_leb_slab) if (ai->aeb_slab_cache)
kmem_cache_destroy(ai->scan_leb_slab); kmem_cache_destroy(ai->aeb_slab_cache);
kfree(ai); kfree(ai);
} }
......
...@@ -110,7 +110,7 @@ struct ubi_ainf_volume { ...@@ -110,7 +110,7 @@ struct ubi_ainf_volume {
* @mean_ec: mean erase counter value * @mean_ec: mean erase counter value
* @ec_sum: a temporary variable used when calculating @mean_ec * @ec_sum: a temporary variable used when calculating @mean_ec
* @ec_count: a temporary variable used when calculating @mean_ec * @ec_count: a temporary variable used when calculating @mean_ec
* @scan_leb_slab: slab cache for &struct ubi_ainf_peb objects * @aeb_slab_cache: slab cache for &struct ubi_ainf_peb objects
* *
* This data structure contains the result of attaching an MTD device and may * This data structure contains the result of attaching an MTD device and may
* be used by other UBI sub-systems to build final UBI data structures, further * be used by other UBI sub-systems to build final UBI data structures, further
...@@ -136,7 +136,7 @@ struct ubi_attach_info { ...@@ -136,7 +136,7 @@ struct ubi_attach_info {
int mean_ec; int mean_ec;
uint64_t ec_sum; uint64_t ec_sum;
int ec_count; int ec_count;
struct kmem_cache *scan_leb_slab; struct kmem_cache *aeb_slab_cache;
}; };
struct ubi_device; struct ubi_device;
......
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