Skip to content

Commit

Permalink
slub: Add dummy functions for the !SLUB_DEBUG case
Browse files Browse the repository at this point in the history
On Wed, 25 Aug 2010, Randy Dunlap wrote:
> mm/slub.c:1732: error: implicit declaration of function 'slab_pre_alloc_hook'
> mm/slub.c:1751: error: implicit declaration of function 'slab_post_alloc_hook'
> mm/slub.c:1881: error: implicit declaration of function 'slab_free_hook'
> mm/slub.c:1886: error: implicit declaration of function 'slab_free_hook_irq'

Empty functions are missing if the runtime debuggability option is compiled
out.

Provide the fall back functions to empty hooks if SLUB_DEBUG is not set.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Oct 2, 2010
1 parent 8df275a commit 7d550c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,18 @@ static inline void inc_slabs_node(struct kmem_cache *s, int node,
int objects) {}
static inline void dec_slabs_node(struct kmem_cache *s, int node,
int objects) {}

static inline int slab_pre_alloc_hook(struct kmem_cache *s, gfp_t flags)
{ return 0; }

static inline void slab_post_alloc_hook(struct kmem_cache *s, gfp_t flags,
void *object) {}

static inline void slab_free_hook(struct kmem_cache *s, void *x) {}

static inline void slab_free_hook_irq(struct kmem_cache *s,
void *object) {}

#endif

/*
Expand Down

0 comments on commit 7d550c5

Please sign in to comment.