Commit db8450673458e724229e91050ac9a92253b01234

Authored by Christoph Lameter
Committed by Pekka Enberg
1 parent c601fd6956

slab: Fixup CONFIG_PAGE_ALLOC/DEBUG_SLAB_LEAK sections

Variables were not properly converted and the conversion caused
a naming conflict.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

Showing 1 changed file with 15 additions and 14 deletions Side-by-side Diff

... ... @@ -2306,8 +2306,9 @@
2306 2306 }
2307 2307 #if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
2308 2308 if (size >= kmalloc_size(INDEX_NODE + 1)
2309   - && cachep->object_size > cache_line_size() && ALIGN(size, align) < PAGE_SIZE) {
2310   - cachep->obj_offset += PAGE_SIZE - ALIGN(size, align);
  2309 + && cachep->object_size > cache_line_size()
  2310 + && ALIGN(size, cachep->align) < PAGE_SIZE) {
  2311 + cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
2311 2312 size = PAGE_SIZE;
2312 2313 }
2313 2314 #endif
... ... @@ -4377,7 +4378,7 @@
4377 4378 struct slab *slabp;
4378 4379 struct kmem_cache_node *n;
4379 4380 const char *name;
4380   - unsigned long *n = m->private;
  4381 + unsigned long *x = m->private;
4381 4382 int node;
4382 4383 int i;
4383 4384  
... ... @@ -4388,7 +4389,7 @@
4388 4389  
4389 4390 /* OK, we can do it */
4390 4391  
4391   - n[1] = 0;
  4392 + x[1] = 0;
4392 4393  
4393 4394 for_each_online_node(node) {
4394 4395 n = cachep->node[node];
4395 4396  
4396 4397  
4397 4398  
4398 4399  
4399 4400  
4400 4401  
... ... @@ -4399,32 +4400,32 @@
4399 4400 spin_lock_irq(&n->list_lock);
4400 4401  
4401 4402 list_for_each_entry(slabp, &n->slabs_full, list)
4402   - handle_slab(n, cachep, slabp);
  4403 + handle_slab(x, cachep, slabp);
4403 4404 list_for_each_entry(slabp, &n->slabs_partial, list)
4404   - handle_slab(n, cachep, slabp);
  4405 + handle_slab(x, cachep, slabp);
4405 4406 spin_unlock_irq(&n->list_lock);
4406 4407 }
4407 4408 name = cachep->name;
4408   - if (n[0] == n[1]) {
  4409 + if (x[0] == x[1]) {
4409 4410 /* Increase the buffer size */
4410 4411 mutex_unlock(&slab_mutex);
4411   - m->private = kzalloc(n[0] * 4 * sizeof(unsigned long), GFP_KERNEL);
  4412 + m->private = kzalloc(x[0] * 4 * sizeof(unsigned long), GFP_KERNEL);
4412 4413 if (!m->private) {
4413 4414 /* Too bad, we are really out */
4414   - m->private = n;
  4415 + m->private = x;
4415 4416 mutex_lock(&slab_mutex);
4416 4417 return -ENOMEM;
4417 4418 }
4418   - *(unsigned long *)m->private = n[0] * 2;
4419   - kfree(n);
  4419 + *(unsigned long *)m->private = x[0] * 2;
  4420 + kfree(x);
4420 4421 mutex_lock(&slab_mutex);
4421 4422 /* Now make sure this entry will be retried */
4422 4423 m->count = m->size;
4423 4424 return 0;
4424 4425 }
4425   - for (i = 0; i < n[1]; i++) {
4426   - seq_printf(m, "%s: %lu ", name, n[2*i+3]);
4427   - show_symbol(m, n[2*i+2]);
  4426 + for (i = 0; i < x[1]; i++) {
  4427 + seq_printf(m, "%s: %lu ", name, x[2*i+3]);
  4428 + show_symbol(m, x[2*i+2]);
4428 4429 seq_putc(m, '\n');
4429 4430 }
4430 4431