提交 361d575e 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

slab: make create_boot_cache() work with 32-bit sizes

struct kmem_cache::size has always been "int", all those
"size_t size" are fake.

Link: http://lkml.kernel.org/r/20180305200730.15812-5-adobriyan@gmail.comSigned-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 55de8b9c
...@@ -97,8 +97,8 @@ struct kmem_cache *create_kmalloc_cache(const char *name, unsigned int size, ...@@ -97,8 +97,8 @@ struct kmem_cache *create_kmalloc_cache(const char *name, unsigned int size,
slab_flags_t flags, unsigned int useroffset, slab_flags_t flags, unsigned int useroffset,
unsigned int usersize); unsigned int usersize);
extern void create_boot_cache(struct kmem_cache *, const char *name, extern void create_boot_cache(struct kmem_cache *, const char *name,
size_t size, slab_flags_t flags, size_t useroffset, unsigned int size, slab_flags_t flags,
size_t usersize); unsigned int useroffset, unsigned int usersize);
int slab_unmergeable(struct kmem_cache *s); int slab_unmergeable(struct kmem_cache *s);
struct kmem_cache *find_mergeable(size_t size, size_t align, struct kmem_cache *find_mergeable(size_t size, size_t align,
......
...@@ -917,8 +917,9 @@ bool slab_is_available(void) ...@@ -917,8 +917,9 @@ bool slab_is_available(void)
#ifndef CONFIG_SLOB #ifndef CONFIG_SLOB
/* Create a cache during boot when no slab services are available yet */ /* Create a cache during boot when no slab services are available yet */
void __init create_boot_cache(struct kmem_cache *s, const char *name, size_t size, void __init create_boot_cache(struct kmem_cache *s, const char *name,
slab_flags_t flags, size_t useroffset, size_t usersize) unsigned int size, slab_flags_t flags,
unsigned int useroffset, unsigned int usersize)
{ {
int err; int err;
...@@ -933,7 +934,7 @@ void __init create_boot_cache(struct kmem_cache *s, const char *name, size_t siz ...@@ -933,7 +934,7 @@ void __init create_boot_cache(struct kmem_cache *s, const char *name, size_t siz
err = __kmem_cache_create(s, flags); err = __kmem_cache_create(s, flags);
if (err) if (err)
panic("Creation of kmalloc slab %s size=%zu failed. Reason %d\n", panic("Creation of kmalloc slab %s size=%u failed. Reason %d\n",
name, size, err); name, size, err);
s->refcount = -1; /* Exempt from merging for now */ s->refcount = -1; /* Exempt from merging for now */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册