diff options
| author | Eric Suen <ericsu@linux.microsoft.com> | 2024-08-27 10:40:03 -0700 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2024-08-27 18:42:27 -0400 |
| commit | 4ad858bd6fbe21c563f177d499da5f99b4b2480e (patch) | |
| tree | 437609c3b30f4212a01b050a54aee393bbb270f5 /security/selinux/avc.c | |
| parent | selinux: annotate false positive data race to avoid KCSAN warnings (diff) | |
| download | linux-4ad858bd6fbe21c563f177d499da5f99b4b2480e.tar.gz linux-4ad858bd6fbe21c563f177d499da5f99b4b2480e.zip | |
selinux: replace kmem_cache_create() with KMEM_CACHE()
Based on guidance in include/linux/slab.h, replace kmem_cache_create()
with KMEM_CACHE() for sources under security/selinux to simplify creation
of SLAB caches.
Signed-off-by: Eric Suen <ericsu@linux.microsoft.com>
[PM: minor grammar nits in the description]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/avc.c')
| -rw-r--r-- | security/selinux/avc.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 32eb67fb3e42..1ec377ce6d22 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -134,18 +134,10 @@ static inline u32 avc_hash(u32 ssid, u32 tsid, u16 tclass) */ void __init avc_init(void) { - avc_node_cachep = kmem_cache_create("avc_node", sizeof(struct avc_node), - 0, SLAB_PANIC, NULL); - avc_xperms_cachep = kmem_cache_create("avc_xperms_node", - sizeof(struct avc_xperms_node), - 0, SLAB_PANIC, NULL); - avc_xperms_decision_cachep = kmem_cache_create( - "avc_xperms_decision_node", - sizeof(struct avc_xperms_decision_node), - 0, SLAB_PANIC, NULL); - avc_xperms_data_cachep = kmem_cache_create("avc_xperms_data", - sizeof(struct extended_perms_data), - 0, SLAB_PANIC, NULL); + avc_node_cachep = KMEM_CACHE(avc_node, SLAB_PANIC); + avc_xperms_cachep = KMEM_CACHE(avc_xperms_node, SLAB_PANIC); + avc_xperms_decision_cachep = KMEM_CACHE(avc_xperms_decision_node, SLAB_PANIC); + avc_xperms_data_cachep = KMEM_CACHE(extended_perms_data, SLAB_PANIC); } int avc_get_hash_stats(char *page) |
