aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2021-11-01 17:02:30 +0100
committerVlastimil Babka <vbabka@suse.cz>2022-01-06 12:25:25 +0100
commitc798154311e10ddba56a515c8ddce14e592bbe25 (patch)
tree03fe587fa4cb7cc9a0ed6b83cacb691ee2a8030d
parentmm: add virt_to_folio() and folio_address() (diff)
downloadlinux-dev-c798154311e10ddba56a515c8ddce14e592bbe25.tar.xz
linux-dev-c798154311e10ddba56a515c8ddce14e592bbe25.zip
mm/slab: Dissolve slab_map_pages() in its caller
The function no longer does what its name and comment suggests, and just sets two struct page fields, which can be done directly in its sole caller. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: Roman Gushchin <guro@fb.com> Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
-rw-r--r--mm/slab.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/mm/slab.c b/mm/slab.c
index ca4822f6b2b6..381875e23277 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2547,18 +2547,6 @@ static void slab_put_obj(struct kmem_cache *cachep,
}
/*
- * Map pages beginning at addr to the given cache and slab. This is required
- * for the slab allocator to be able to lookup the cache and slab of a
- * virtual address for kfree, ksize, and slab debugging.
- */
-static void slab_map_pages(struct kmem_cache *cache, struct page *page,
- void *freelist)
-{
- page->slab_cache = cache;
- page->freelist = freelist;
-}
-
-/*
* Grow (by 1) the number of slabs within a cache. This is called by
* kmem_cache_alloc() when there are no active objs left in a cache.
*/
@@ -2621,7 +2609,8 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep,
if (OFF_SLAB(cachep) && !freelist)
goto opps1;
- slab_map_pages(cachep, page, freelist);
+ page->slab_cache = cachep;
+ page->freelist = freelist;
cache_init_objs(cachep, page);