diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-10-17 02:25:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:45 -0400 |
commit | 4ba9b9d0ba0a49d91fa6417c7510ee36f48cf957 (patch) | |
tree | 191b4f45f926e44b882b1e87a9a85dc12230b892 /mm/slub.c | |
parent | b811c202a0edadaac7242ab834fe7ba409978ae7 (diff) |
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>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -980,7 +980,7 @@ __setup("slub_debug", setup_slub_debug); | |||
980 | 980 | ||
981 | static unsigned long kmem_cache_flags(unsigned long objsize, | 981 | static unsigned long kmem_cache_flags(unsigned long objsize, |
982 | unsigned long flags, const char *name, | 982 | unsigned long flags, const char *name, |
983 | void (*ctor)(void *, struct kmem_cache *, unsigned long)) | 983 | void (*ctor)(struct kmem_cache *, void *)) |
984 | { | 984 | { |
985 | /* | 985 | /* |
986 | * The page->offset field is only 16 bit wide. This is an offset | 986 | * 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, | |||
1027 | static inline void add_full(struct kmem_cache_node *n, struct page *page) {} | 1027 | static inline void add_full(struct kmem_cache_node *n, struct page *page) {} |
1028 | static inline unsigned long kmem_cache_flags(unsigned long objsize, | 1028 | static inline unsigned long kmem_cache_flags(unsigned long objsize, |
1029 | unsigned long flags, const char *name, | 1029 | unsigned long flags, const char *name, |
1030 | void (*ctor)(void *, struct kmem_cache *, unsigned long)) | 1030 | void (*ctor)(struct kmem_cache *, void *)) |
1031 | { | 1031 | { |
1032 | return flags; | 1032 | return flags; |
1033 | } | 1033 | } |
@@ -1071,7 +1071,7 @@ static void setup_object(struct kmem_cache *s, struct page *page, | |||
1071 | { | 1071 | { |
1072 | setup_object_debug(s, page, object); | 1072 | setup_object_debug(s, page, object); |
1073 | if (unlikely(s->ctor)) | 1073 | if (unlikely(s->ctor)) |
1074 | s->ctor(object, s, 0); | 1074 | s->ctor(s, object); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) | 1077 | 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) | |||
2211 | static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags, | 2211 | static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags, |
2212 | const char *name, size_t size, | 2212 | const char *name, size_t size, |
2213 | size_t align, unsigned long flags, | 2213 | size_t align, unsigned long flags, |
2214 | void (*ctor)(void *, struct kmem_cache *, unsigned long)) | 2214 | void (*ctor)(struct kmem_cache *, void *)) |
2215 | { | 2215 | { |
2216 | memset(s, 0, kmem_size); | 2216 | memset(s, 0, kmem_size); |
2217 | s->name = name; | 2217 | s->name = name; |
@@ -2801,7 +2801,7 @@ static int slab_unmergeable(struct kmem_cache *s) | |||
2801 | 2801 | ||
2802 | static struct kmem_cache *find_mergeable(size_t size, | 2802 | static struct kmem_cache *find_mergeable(size_t size, |
2803 | size_t align, unsigned long flags, const char *name, | 2803 | size_t align, unsigned long flags, const char *name, |
2804 | void (*ctor)(void *, struct kmem_cache *, unsigned long)) | 2804 | void (*ctor)(struct kmem_cache *, void *)) |
2805 | { | 2805 | { |
2806 | struct kmem_cache *s; | 2806 | struct kmem_cache *s; |
2807 | 2807 | ||
@@ -2842,7 +2842,7 @@ static struct kmem_cache *find_mergeable(size_t size, | |||
2842 | 2842 | ||
2843 | struct kmem_cache *kmem_cache_create(const char *name, size_t size, | 2843 | struct kmem_cache *kmem_cache_create(const char *name, size_t size, |
2844 | size_t align, unsigned long flags, | 2844 | size_t align, unsigned long flags, |
2845 | void (*ctor)(void *, struct kmem_cache *, unsigned long)) | 2845 | void (*ctor)(struct kmem_cache *, void *)) |
2846 | { | 2846 | { |
2847 | struct kmem_cache *s; | 2847 | struct kmem_cache *s; |
2848 | 2848 | ||