aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-07-17 07:03:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:23:01 -0400
commit7b55f620e6908fec2d51751320c2a9459b5f375f (patch)
tree6fb32a7051b4358018fb26a3125e3b9621418abe /mm/slub.c
parentf1b263393626fe66bee34ccdbf0487cd377e0213 (diff)
SLUB: Simplify dma index -> size calculation
There is no need to caculate the dma slab size ourselves. We can simply lookup the size of the corresponding non dma slab. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 71988f9b9c55..2ae2dae12d9a 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2289,15 +2289,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags)
2289 if (!x) 2289 if (!x)
2290 panic("Unable to allocate memory for dma cache\n"); 2290 panic("Unable to allocate memory for dma cache\n");
2291 2291
2292 if (index <= KMALLOC_SHIFT_HIGH) 2292 realsize = kmalloc_caches[index].objsize;
2293 realsize = 1 << index;
2294 else {
2295 if (index == 1)
2296 realsize = 96;
2297 else
2298 realsize = 192;
2299 }
2300
2301 text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d", 2293 text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d",
2302 (unsigned int)realsize); 2294 (unsigned int)realsize);
2303 s = create_kmalloc_cache(x, text, realsize, flags); 2295 s = create_kmalloc_cache(x, text, realsize, flags);