Skip to content

Commit

Permalink
slab: use well-defined macro, virt_to_slab()
Browse files Browse the repository at this point in the history
This is trivial change, just use well-defined macro.

Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Pekka Enberg <penberg@iki.fi>
  • Loading branch information
Joonsoo Kim authored and Pekka Enberg committed Oct 24, 2013
1 parent 6812670 commit 56f295e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2865,17 +2865,14 @@ static inline void verify_redzone_free(struct kmem_cache *cache, void *obj)
static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,
unsigned long caller)
{
struct page *page;
unsigned int objnr;
struct slab *slabp;

BUG_ON(virt_to_cache(objp) != cachep);

objp -= obj_offset(cachep);
kfree_debugcheck(objp);
page = virt_to_head_page(objp);

slabp = page->slab_page;
slabp = virt_to_slab(objp);

if (cachep->flags & SLAB_RED_ZONE) {
verify_redzone_free(cachep, objp);
Expand Down Expand Up @@ -3087,7 +3084,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
struct slab *slabp;
unsigned objnr;

slabp = virt_to_head_page(objp)->slab_page;
slabp = virt_to_slab(objp);
objnr = (unsigned)(objp - slabp->s_mem) / cachep->size;
slab_bufctl(slabp)[objnr] = BUFCTL_ACTIVE;
}
Expand Down

0 comments on commit 56f295e

Please sign in to comment.