diff options
author | Christoph Lameter <cl@linux.com> | 2012-06-13 10:24:55 -0500 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-06-14 09:19:56 +0300 |
commit | e571b0ad3495be5793e54e21cd244c4545c49d88 (patch) | |
tree | 4ea18038e9543483d4f31519cf95f9d633ca0ef7 /mm/slab.c | |
parent | b5568280c9b9162b384be9d447013b74d682d4b3 (diff) | |
download | linux-e571b0ad3495be5793e54e21cd244c4545c49d88.tar.gz linux-e571b0ad3495be5793e54e21cd244c4545c49d88.tar.bz2 linux-e571b0ad3495be5793e54e21cd244c4545c49d88.zip |
slab: Use page struct fields instead of casting
Add fields to the page struct so that it is properly documented that
slab overlays the lru fields.
This cleans up some casts in slab.
Reviewed-by: Glauber Costa <glommer@parallels.com>
Reviewed-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/slab.c b/mm/slab.c index e901a36e2520..af05147d7abd 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -496,25 +496,25 @@ static bool slab_max_order_set __initdata; */ static inline void page_set_cache(struct page *page, struct kmem_cache *cache) { - page->lru.next = (struct list_head *)cache; + page->slab_cache = cache; } static inline struct kmem_cache *page_get_cache(struct page *page) { page = compound_head(page); BUG_ON(!PageSlab(page)); - return (struct kmem_cache *)page->lru.next; + return page->slab_cache; } static inline void page_set_slab(struct page *page, struct slab *slab) { - page->lru.prev = (struct list_head *)slab; + page->slab_page = slab; } static inline struct slab *page_get_slab(struct page *page) { BUG_ON(!PageSlab(page)); - return (struct slab *)page->lru.prev; + return page->slab_page; } static inline struct kmem_cache *virt_to_cache(const void *obj) |