Skip to content

Commit

Permalink
slab: rename slab_destroy_objs
Browse files Browse the repository at this point in the history
With the removal of destructors, slab_destroy_objs no longer actually
destroys any objects, making the kernel doc incorrect and the function
name misleading.

In keeping with the other debug functions, rename it to
slab_destroy_debugcheck and drop the kernel doc.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
Rabin Vincent authored and Pekka Enberg committed Jul 15, 2008
1 parent 88e4ccf commit e79aec2
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,15 +1901,7 @@ static void check_poison_obj(struct kmem_cache *cachep, void *objp)
#endif

#if DEBUG
/**
* slab_destroy_objs - destroy a slab and its objects
* @cachep: cache pointer being destroyed
* @slabp: slab pointer being destroyed
*
* Call the registered destructor for each object in a slab that is being
* destroyed.
*/
static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
static void slab_destroy_debugcheck(struct kmem_cache *cachep, struct slab *slabp)
{
int i;
for (i = 0; i < cachep->num; i++) {
Expand Down Expand Up @@ -1938,7 +1930,7 @@ static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
}
}
#else
static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
static void slab_destroy_debugcheck(struct kmem_cache *cachep, struct slab *slabp)
{
}
#endif
Expand All @@ -1956,7 +1948,7 @@ static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
{
void *addr = slabp->s_mem - slabp->colouroff;

slab_destroy_objs(cachep, slabp);
slab_destroy_debugcheck(cachep, slabp);
if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU)) {
struct slab_rcu *slab_rcu;

Expand Down

0 comments on commit e79aec2

Please sign in to comment.