소스 검색

count_partial() is not used if !SLUB_DEBUG and !CONFIG_SLABINFO

Avoid warnings about unused functions if neither SLUB_DEBUG nor CONFIG_SLABINFO
is defined. This patch will be reversed when slab defrag is merged since slab
defrag requires count_partial() to determine the fragmentation status of
slab caches.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Christoph Lameter 17 년 전
부모
커밋
53625b4204
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      mm/slub.c

+ 2 - 0
mm/slub.c

@@ -2685,6 +2685,7 @@ void kfree(const void *x)
 }
 }
 EXPORT_SYMBOL(kfree);
 EXPORT_SYMBOL(kfree);
 
 
+#if defined(SLUB_DEBUG) || defined(CONFIG_SLABINFO)
 static unsigned long count_partial(struct kmem_cache_node *n)
 static unsigned long count_partial(struct kmem_cache_node *n)
 {
 {
 	unsigned long flags;
 	unsigned long flags;
@@ -2697,6 +2698,7 @@ static unsigned long count_partial(struct kmem_cache_node *n)
 	spin_unlock_irqrestore(&n->list_lock, flags);
 	spin_unlock_irqrestore(&n->list_lock, flags);
 	return x;
 	return x;
 }
 }
+#endif
 
 
 /*
 /*
  * kmem_cache_shrink removes empty slabs from the partial lists and sorts
  * kmem_cache_shrink removes empty slabs from the partial lists and sorts