|
@@ -937,14 +937,15 @@ void __init create_boot_cache(struct kmem_cache *s, const char *name, size_t siz
|
|
}
|
|
}
|
|
|
|
|
|
struct kmem_cache *__init create_kmalloc_cache(const char *name, size_t size,
|
|
struct kmem_cache *__init create_kmalloc_cache(const char *name, size_t size,
|
|
- slab_flags_t flags)
|
|
|
|
|
|
+ slab_flags_t flags, size_t useroffset,
|
|
|
|
+ size_t usersize)
|
|
{
|
|
{
|
|
struct kmem_cache *s = kmem_cache_zalloc(kmem_cache, GFP_NOWAIT);
|
|
struct kmem_cache *s = kmem_cache_zalloc(kmem_cache, GFP_NOWAIT);
|
|
|
|
|
|
if (!s)
|
|
if (!s)
|
|
panic("Out of memory when creating slab %s\n", name);
|
|
panic("Out of memory when creating slab %s\n", name);
|
|
|
|
|
|
- create_boot_cache(s, name, size, flags, 0, size);
|
|
|
|
|
|
+ create_boot_cache(s, name, size, flags, useroffset, usersize);
|
|
list_add(&s->list, &slab_caches);
|
|
list_add(&s->list, &slab_caches);
|
|
memcg_link_cache(s);
|
|
memcg_link_cache(s);
|
|
s->refcount = 1;
|
|
s->refcount = 1;
|
|
@@ -1098,7 +1099,8 @@ void __init setup_kmalloc_cache_index_table(void)
|
|
static void __init new_kmalloc_cache(int idx, slab_flags_t flags)
|
|
static void __init new_kmalloc_cache(int idx, slab_flags_t flags)
|
|
{
|
|
{
|
|
kmalloc_caches[idx] = create_kmalloc_cache(kmalloc_info[idx].name,
|
|
kmalloc_caches[idx] = create_kmalloc_cache(kmalloc_info[idx].name,
|
|
- kmalloc_info[idx].size, flags);
|
|
|
|
|
|
+ kmalloc_info[idx].size, flags, 0,
|
|
|
|
+ kmalloc_info[idx].size);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1139,7 +1141,7 @@ void __init create_kmalloc_caches(slab_flags_t flags)
|
|
|
|
|
|
BUG_ON(!n);
|
|
BUG_ON(!n);
|
|
kmalloc_dma_caches[i] = create_kmalloc_cache(n,
|
|
kmalloc_dma_caches[i] = create_kmalloc_cache(n,
|
|
- size, SLAB_CACHE_DMA | flags);
|
|
|
|
|
|
+ size, SLAB_CACHE_DMA | flags, 0, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|