mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-11 15:40:50 +00:00
mm/slub: Simplify __kmem_cache_alias()
There is no need to do anything if sysfs_slab_alias() return nonzero value after getting a mergeable cache. Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Link: https://lore.kernel.org/all/e5ebc952-af17-321f-5343-bc914d47c931@suse.cz/ Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
This commit is contained in:
parent
d1ca263d0d
commit
efb9352700
@ -4890,6 +4890,9 @@ __kmem_cache_alias(const char *name, unsigned int size, unsigned int align,
|
||||
|
||||
s = find_mergeable(size, align, flags, name, ctor);
|
||||
if (s) {
|
||||
if (sysfs_slab_alias(s, name))
|
||||
return NULL;
|
||||
|
||||
s->refcount++;
|
||||
|
||||
/*
|
||||
@ -4898,11 +4901,6 @@ __kmem_cache_alias(const char *name, unsigned int size, unsigned int align,
|
||||
*/
|
||||
s->object_size = max(s->object_size, size);
|
||||
s->inuse = max(s->inuse, ALIGN(size, sizeof(void *)));
|
||||
|
||||
if (sysfs_slab_alias(s, name)) {
|
||||
s->refcount--;
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
|
Loading…
x
Reference in New Issue
Block a user