summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2024-07-01 22:12:58 +0300
committerVlastimil Babka <vbabka@suse.cz>2024-07-03 13:24:19 +0300
commit72e0fe2241ce113cbba339ca8c2450b167774530 (patch)
tree07b844d9297b807a9c3bf567b2ca10ec387a0c60 /include
parentad59baa3169591e0b4cf1a217c9139f2145f4c7f (diff)
downloadlinux-72e0fe2241ce113cbba339ca8c2450b167774530.tar.xz
mm/slab: Introduce kmem_buckets typedef
Encapsulate the concept of a single set of kmem_caches that are used for the kmalloc size buckets. Redefine kmalloc_caches as an array of these buckets (for the different global cache buckets). Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/linux/slab.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 640cea6e6323..922bf15794f7 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -426,8 +426,9 @@ enum kmalloc_cache_type {
NR_KMALLOC_TYPES
};
-extern struct kmem_cache *
-kmalloc_caches[NR_KMALLOC_TYPES][KMALLOC_SHIFT_HIGH + 1];
+typedef struct kmem_cache * kmem_buckets[KMALLOC_SHIFT_HIGH + 1];
+
+extern kmem_buckets kmalloc_caches[NR_KMALLOC_TYPES];
/*
* Define gfp bits that should not be set for KMALLOC_NORMAL.