提交 f6acb635 编写于 作者: C Christoph Lameter 提交者: Pekka Enberg

slub: #ifdef simplification

If we make SLUB_DEBUG depend on SYSFS then we can simplify some
#ifdefs and avoid others.
Signed-off-by: NChristoph Lameter <clameter@sgi.com>
Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
上级 f715e6f1
...@@ -720,7 +720,7 @@ config VM_EVENT_COUNTERS ...@@ -720,7 +720,7 @@ config VM_EVENT_COUNTERS
config SLUB_DEBUG config SLUB_DEBUG
default y default y
bool "Enable SLUB debugging support" if EMBEDDED bool "Enable SLUB debugging support" if EMBEDDED
depends on SLUB depends on SLUB && SYSFS
help help
SLUB has extensive debug support features. Disabling these can SLUB has extensive debug support features. Disabling these can
result in significant savings in code size. This also disables result in significant savings in code size. This also disables
......
...@@ -217,7 +217,7 @@ struct track { ...@@ -217,7 +217,7 @@ struct track {
enum track_item { TRACK_ALLOC, TRACK_FREE }; enum track_item { TRACK_ALLOC, TRACK_FREE };
#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG) #ifdef CONFIG_SLUB_DEBUG
static int sysfs_slab_add(struct kmem_cache *); static int sysfs_slab_add(struct kmem_cache *);
static int sysfs_slab_alias(struct kmem_cache *, const char *); static int sysfs_slab_alias(struct kmem_cache *, const char *);
static void sysfs_slab_remove(struct kmem_cache *); static void sysfs_slab_remove(struct kmem_cache *);
...@@ -3247,7 +3247,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags, ...@@ -3247,7 +3247,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
return slab_alloc(s, gfpflags, node, caller); return slab_alloc(s, gfpflags, node, caller);
} }
#if (defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)) || defined(CONFIG_SLABINFO) #ifdef CONFIG_SLUB_DEBUG
static unsigned long count_partial(struct kmem_cache_node *n, static unsigned long count_partial(struct kmem_cache_node *n,
int (*get_count)(struct page *)) int (*get_count)(struct page *))
{ {
...@@ -3276,9 +3276,7 @@ static int count_free(struct page *page) ...@@ -3276,9 +3276,7 @@ static int count_free(struct page *page)
{ {
return page->objects - page->inuse; return page->objects - page->inuse;
} }
#endif
#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)
static int validate_slab(struct kmem_cache *s, struct page *page, static int validate_slab(struct kmem_cache *s, struct page *page,
unsigned long *map) unsigned long *map)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册