Commit d2158f69 authored by Richard Weinberger's avatar Richard Weinberger

UBI: Remove alloc_ai() slab name from parameter list

There is always exactly one ubi_attach_info object allocated,
therefore we don't have to care about the name.
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 98105d08
...@@ -1301,7 +1301,7 @@ static int scan_all(struct ubi_device *ubi, struct ubi_attach_info *ai, ...@@ -1301,7 +1301,7 @@ static int scan_all(struct ubi_device *ubi, struct ubi_attach_info *ai,
return err; return err;
} }
static struct ubi_attach_info *alloc_ai(const char *slab_name) static struct ubi_attach_info *alloc_ai(void)
{ {
struct ubi_attach_info *ai; struct ubi_attach_info *ai;
...@@ -1314,7 +1314,7 @@ static struct ubi_attach_info *alloc_ai(const char *slab_name) ...@@ -1314,7 +1314,7 @@ static struct ubi_attach_info *alloc_ai(const char *slab_name)
INIT_LIST_HEAD(&ai->erase); INIT_LIST_HEAD(&ai->erase);
INIT_LIST_HEAD(&ai->alien); INIT_LIST_HEAD(&ai->alien);
ai->volumes = RB_ROOT; ai->volumes = RB_ROOT;
ai->aeb_slab_cache = kmem_cache_create(slab_name, 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->aeb_slab_cache) { if (!ai->aeb_slab_cache) {
...@@ -1375,7 +1375,7 @@ static int scan_fast(struct ubi_device *ubi, struct ubi_attach_info **ai) ...@@ -1375,7 +1375,7 @@ static int scan_fast(struct ubi_device *ubi, struct ubi_attach_info **ai)
return UBI_NO_FASTMAP; return UBI_NO_FASTMAP;
destroy_ai(*ai); destroy_ai(*ai);
*ai = alloc_ai("ubi_aeb_slab_cache"); *ai = alloc_ai();
if (!*ai) if (!*ai)
return -ENOMEM; return -ENOMEM;
...@@ -1404,7 +1404,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan) ...@@ -1404,7 +1404,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
int err; int err;
struct ubi_attach_info *ai; struct ubi_attach_info *ai;
ai = alloc_ai("ubi_aeb_slab_cache"); ai = alloc_ai();
if (!ai) if (!ai)
return -ENOMEM; return -ENOMEM;
...@@ -1422,7 +1422,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan) ...@@ -1422,7 +1422,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
if (err > 0) { if (err > 0) {
if (err != UBI_NO_FASTMAP) { if (err != UBI_NO_FASTMAP) {
destroy_ai(ai); destroy_ai(ai);
ai = alloc_ai("ubi_aeb_slab_cache2"); ai = alloc_ai();
if (!ai) if (!ai)
return -ENOMEM; return -ENOMEM;
...@@ -1461,7 +1461,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan) ...@@ -1461,7 +1461,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
if (ubi->fm && ubi_dbg_chk_gen(ubi)) { if (ubi->fm && ubi_dbg_chk_gen(ubi)) {
struct ubi_attach_info *scan_ai; struct ubi_attach_info *scan_ai;
scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache"); scan_ai = alloc_ai();
if (!scan_ai) { if (!scan_ai) {
err = -ENOMEM; err = -ENOMEM;
goto out_wl; goto out_wl;
......
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