Skip to content

Commit

Permalink
slub: #ifdef simplification
Browse files Browse the repository at this point in the history
If we make SLUB_DEBUG depend on SYSFS then we can simplify some
#ifdefs and avoid others.

Signed-off-by: Christoph Lameter <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed May 1, 2008
1 parent f715e6f commit f6acb63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ config VM_EVENT_COUNTERS
config SLUB_DEBUG
default y
bool "Enable SLUB debugging support" if EMBEDDED
depends on SLUB
depends on SLUB && SYSFS
help
SLUB has extensive debug support features. Disabling these can
result in significant savings in code size. This also disables
Expand Down
6 changes: 2 additions & 4 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ struct track {

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_alias(struct kmem_cache *, const char *);
static void sysfs_slab_remove(struct kmem_cache *);
Expand Down Expand Up @@ -3247,7 +3247,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
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,
int (*get_count)(struct page *))
{
Expand Down Expand Up @@ -3276,9 +3276,7 @@ static int count_free(struct page *page)
{
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,
unsigned long *map)
{
Expand Down

0 comments on commit f6acb63

Please sign in to comment.