Skip to content

Commit edc6670

Browse files
KunWuChanpcmoore
authored andcommitted
cred: Use KMEM_CACHE() instead of kmem_cache_create()
Commit 0a31bd5 ("KMEM_CACHE(): simplify slab cache creation") introduces a new macro. Use the new KMEM_CACHE() macro instead of direct kmem_cache_create() to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan <[email protected]> [PM: alignment fixes in both code and description] Signed-off-by: Paul Moore <[email protected]>
1 parent 260017f commit edc6670

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/cred.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ int set_cred_ucounts(struct cred *new)
606606
void __init cred_init(void)
607607
{
608608
/* allocate a slab in which we can store credentials */
609-
cred_jar = kmem_cache_create("cred_jar", sizeof(struct cred), 0,
610-
SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT, NULL);
609+
cred_jar = KMEM_CACHE(cred,
610+
SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
611611
}
612612

613613
/**

0 commit comments

Comments
 (0)