diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-29 19:16:06 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-05-01 17:27:13 -0400 |
commit | f6acb63508700b5f8cd817082b62c96ba907775e (patch) | |
tree | 0fc0cdd4660fdf186f3becc1b80d743f8d3edbea | |
parent | f715e6f15ee167026581a8a2e09b2ed644b974aa (diff) |
slub: #ifdef simplification
If we make SLUB_DEBUG depend on SYSFS then we can simplify some
#ifdefs and avoid others.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
-rw-r--r-- | init/Kconfig | 2 | ||||
-rw-r--r-- | mm/slub.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/init/Kconfig b/init/Kconfig index 3e7b257fc05f..6a44defac3ec 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -720,7 +720,7 @@ config VM_EVENT_COUNTERS | |||
720 | config SLUB_DEBUG | 720 | config SLUB_DEBUG |
721 | default y | 721 | default y |
722 | bool "Enable SLUB debugging support" if EMBEDDED | 722 | bool "Enable SLUB debugging support" if EMBEDDED |
723 | depends on SLUB | 723 | depends on SLUB && SYSFS |
724 | help | 724 | help |
725 | SLUB has extensive debug support features. Disabling these can | 725 | SLUB has extensive debug support features. Disabling these can |
726 | result in significant savings in code size. This also disables | 726 | result in significant savings in code size. This also disables |
@@ -217,7 +217,7 @@ struct track { | |||
217 | 217 | ||
218 | enum track_item { TRACK_ALLOC, TRACK_FREE }; | 218 | enum track_item { TRACK_ALLOC, TRACK_FREE }; |
219 | 219 | ||
220 | #if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG) | 220 | #ifdef CONFIG_SLUB_DEBUG |
221 | static int sysfs_slab_add(struct kmem_cache *); | 221 | static int sysfs_slab_add(struct kmem_cache *); |
222 | static int sysfs_slab_alias(struct kmem_cache *, const char *); | 222 | static int sysfs_slab_alias(struct kmem_cache *, const char *); |
223 | static void sysfs_slab_remove(struct kmem_cache *); | 223 | static void sysfs_slab_remove(struct kmem_cache *); |
@@ -3247,7 +3247,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags, | |||
3247 | return slab_alloc(s, gfpflags, node, caller); | 3247 | return slab_alloc(s, gfpflags, node, caller); |
3248 | } | 3248 | } |
3249 | 3249 | ||
3250 | #if (defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)) || defined(CONFIG_SLABINFO) | 3250 | #ifdef CONFIG_SLUB_DEBUG |
3251 | static unsigned long count_partial(struct kmem_cache_node *n, | 3251 | static unsigned long count_partial(struct kmem_cache_node *n, |
3252 | int (*get_count)(struct page *)) | 3252 | int (*get_count)(struct page *)) |
3253 | { | 3253 | { |
@@ -3276,9 +3276,7 @@ static int count_free(struct page *page) | |||
3276 | { | 3276 | { |
3277 | return page->objects - page->inuse; | 3277 | return page->objects - page->inuse; |
3278 | } | 3278 | } |
3279 | #endif | ||
3280 | 3279 | ||
3281 | #if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG) | ||
3282 | static int validate_slab(struct kmem_cache *s, struct page *page, | 3280 | static int validate_slab(struct kmem_cache *s, struct page *page, |
3283 | unsigned long *map) | 3281 | unsigned long *map) |
3284 | { | 3282 | { |