aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index daa53a8fca88..06a2d7062136 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -125,7 +125,7 @@ static int add_to_list(struct ubi_attach_info *ai, int pnum, int ec,
125 } else 125 } else
126 BUG(); 126 BUG();
127 127
128 aeb = kmem_cache_alloc(ai->scan_leb_slab, GFP_KERNEL); 128 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL);
129 if (!aeb) 129 if (!aeb)
130 return -ENOMEM; 130 return -ENOMEM;
131 131
@@ -154,7 +154,7 @@ static int add_corrupted(struct ubi_attach_info *ai, int pnum, int ec)
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
157 aeb = kmem_cache_alloc(ai->scan_leb_slab, GFP_KERNEL); 157 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL);
158 if (!aeb) 158 if (!aeb)
159 return -ENOMEM; 159 return -ENOMEM;
160 160
@@ -562,7 +562,7 @@ int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum,
562 if (err) 562 if (err)
563 return err; 563 return err;
564 564
565 aeb = kmem_cache_alloc(ai->scan_leb_slab, GFP_KERNEL); 565 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL);
566 if (!aeb) 566 if (!aeb)
567 return -ENOMEM; 567 return -ENOMEM;
568 568
@@ -1133,10 +1133,10 @@ struct ubi_attach_info *ubi_scan(struct ubi_device *ubi)
1133 ai->volumes = RB_ROOT; 1133 ai->volumes = RB_ROOT;
1134 1134
1135 err = -ENOMEM; 1135 err = -ENOMEM;
1136 ai->scan_leb_slab = kmem_cache_create("ubi_scan_leb_slab", 1136 ai->aeb_slab_cache = kmem_cache_create("ubi_aeb_slab_cache",
1137 sizeof(struct ubi_ainf_peb), 1137 sizeof(struct ubi_ainf_peb),
1138 0, 0, NULL); 1138 0, 0, NULL);
1139 if (!ai->scan_leb_slab) 1139 if (!ai->aeb_slab_cache)
1140 goto out_ai; 1140 goto out_ai;
1141 1141
1142 ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); 1142 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 this->rb_right = NULL; 1235 this->rb_right = NULL;
1236 } 1236 }
1237 1237
1238 kmem_cache_free(ai->scan_leb_slab, aeb); 1238 kmem_cache_free(ai->aeb_slab_cache, aeb);
1239 } 1239 }
1240 } 1240 }
1241 kfree(av); 1241 kfree(av);
@@ -1253,19 +1253,19 @@ void ubi_destroy_ai(struct ubi_attach_info *ai)
1253 1253
1254 list_for_each_entry_safe(aeb, aeb_tmp, &ai->alien, u.list) { 1254 list_for_each_entry_safe(aeb, aeb_tmp, &ai->alien, u.list) {
1255 list_del(&aeb->u.list); 1255 list_del(&aeb->u.list);
1256 kmem_cache_free(ai->scan_leb_slab, aeb); 1256 kmem_cache_free(ai->aeb_slab_cache, aeb);
1257 } 1257 }
1258 list_for_each_entry_safe(aeb, aeb_tmp, &ai->erase, u.list) { 1258 list_for_each_entry_safe(aeb, aeb_tmp, &ai->erase, u.list) {
1259 list_del(&aeb->u.list); 1259 list_del(&aeb->u.list);
1260 kmem_cache_free(ai->scan_leb_slab, aeb); 1260 kmem_cache_free(ai->aeb_slab_cache, aeb);
1261 } 1261 }
1262 list_for_each_entry_safe(aeb, aeb_tmp, &ai->corr, u.list) { 1262 list_for_each_entry_safe(aeb, aeb_tmp, &ai->corr, u.list) {
1263 list_del(&aeb->u.list); 1263 list_del(&aeb->u.list);
1264 kmem_cache_free(ai->scan_leb_slab, aeb); 1264 kmem_cache_free(ai->aeb_slab_cache, aeb);
1265 } 1265 }
1266 list_for_each_entry_safe(aeb, aeb_tmp, &ai->free, u.list) { 1266 list_for_each_entry_safe(aeb, aeb_tmp, &ai->free, u.list) {
1267 list_del(&aeb->u.list); 1267 list_del(&aeb->u.list);
1268 kmem_cache_free(ai->scan_leb_slab, aeb); 1268 kmem_cache_free(ai->aeb_slab_cache, aeb);
1269 } 1269 }
1270 1270
1271 /* Destroy the volume RB-tree */ 1271 /* Destroy the volume RB-tree */
@@ -1290,8 +1290,8 @@ void ubi_destroy_ai(struct ubi_attach_info *ai)
1290 } 1290 }
1291 } 1291 }
1292 1292
1293 if (ai->scan_leb_slab) 1293 if (ai->aeb_slab_cache)
1294 kmem_cache_destroy(ai->scan_leb_slab); 1294 kmem_cache_destroy(ai->aeb_slab_cache);
1295 1295
1296 kfree(ai); 1296 kfree(ai);
1297} 1297}