Slab API: remove useless ctor parameter and reorder parameters
Slab constructors currently have a flags parameter that is never used. And the order of the arguments is opposite to other slab functions. The object pointer is placed before the kmem_cache pointer. Convert ctor(void *object, struct kmem_cache *s, unsigned long flags) to ctor(struct kmem_cache *s, void *object) throughout the kernel [akpm@linux-foundation.org: coupla fixes] Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
b811c202a0
commit
4ba9b9d0ba
12
mm/slub.c
12
mm/slub.c
@@ -980,7 +980,7 @@ __setup("slub_debug", setup_slub_debug);
|
||||
|
||||
static unsigned long kmem_cache_flags(unsigned long objsize,
|
||||
unsigned long flags, const char *name,
|
||||
void (*ctor)(void *, struct kmem_cache *, unsigned long))
|
||||
void (*ctor)(struct kmem_cache *, void *))
|
||||
{
|
||||
/*
|
||||
* The page->offset field is only 16 bit wide. This is an offset
|
||||
@@ -1027,7 +1027,7 @@ static inline int check_object(struct kmem_cache *s, struct page *page,
|
||||
static inline void add_full(struct kmem_cache_node *n, struct page *page) {}
|
||||
static inline unsigned long kmem_cache_flags(unsigned long objsize,
|
||||
unsigned long flags, const char *name,
|
||||
void (*ctor)(void *, struct kmem_cache *, unsigned long))
|
||||
void (*ctor)(struct kmem_cache *, void *))
|
||||
{
|
||||
return flags;
|
||||
}
|
||||
@@ -1071,7 +1071,7 @@ static void setup_object(struct kmem_cache *s, struct page *page,
|
||||
{
|
||||
setup_object_debug(s, page, object);
|
||||
if (unlikely(s->ctor))
|
||||
s->ctor(object, s, 0);
|
||||
s->ctor(s, object);
|
||||
}
|
||||
|
||||
static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
|
||||
@@ -2211,7 +2211,7 @@ static int calculate_sizes(struct kmem_cache *s)
|
||||
static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags,
|
||||
const char *name, size_t size,
|
||||
size_t align, unsigned long flags,
|
||||
void (*ctor)(void *, struct kmem_cache *, unsigned long))
|
||||
void (*ctor)(struct kmem_cache *, void *))
|
||||
{
|
||||
memset(s, 0, kmem_size);
|
||||
s->name = name;
|
||||
@@ -2801,7 +2801,7 @@ static int slab_unmergeable(struct kmem_cache *s)
|
||||
|
||||
static struct kmem_cache *find_mergeable(size_t size,
|
||||
size_t align, unsigned long flags, const char *name,
|
||||
void (*ctor)(void *, struct kmem_cache *, unsigned long))
|
||||
void (*ctor)(struct kmem_cache *, void *))
|
||||
{
|
||||
struct kmem_cache *s;
|
||||
|
||||
@@ -2842,7 +2842,7 @@ static struct kmem_cache *find_mergeable(size_t size,
|
||||
|
||||
struct kmem_cache *kmem_cache_create(const char *name, size_t size,
|
||||
size_t align, unsigned long flags,
|
||||
void (*ctor)(void *, struct kmem_cache *, unsigned long))
|
||||
void (*ctor)(struct kmem_cache *, void *))
|
||||
{
|
||||
struct kmem_cache *s;
|
||||
|
||||
|
Reference in New Issue
Block a user