slab: use well-defined macro, virt_to_slab()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:02 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=56f295ef0dfa7e1d0be18deebe0c15fb6b2d9d5b
Commit:     56f295ef0dfa7e1d0be18deebe0c15fb6b2d9d5b
Parent:     68126702b419fd26ef4946e314bb3a1f57d3a53f
Author:     Joonsoo Kim <iamjoonsoo.kim at lge.com>
AuthorDate: Thu Oct 24 10:07:43 2013 +0900
Committer:  Pekka Enberg <penberg at iki.fi>
CommitDate: Thu Oct 24 20:17:32 2013 +0300

    slab: use well-defined macro, virt_to_slab()
    
    This is trivial change, just use well-defined macro.
    
    Acked-by: Andi Kleen <ak at linux.intel.com>
    Acked-by: Christoph Lameter <cl at linux.com>
    Signed-off-by: Joonsoo Kim <iamjoonsoo.kim at lge.com>
    Signed-off-by: Pekka Enberg <penberg at iki.fi>
---
 mm/slab.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 84c4ed6..f9e676e 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2865,7 +2865,6 @@ 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;
 
@@ -2873,9 +2872,7 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,
 
 	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);
@@ -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;
 	}



More information about the linux-mtd-cvs mailing list