提交 73c0219d 编写于 作者: G Geliang Tang 提交者: Linus Torvalds

mm/slab.c: use list_for_each_entry in cache_flusharray

Simplify the code with list_for_each_entry().
Signed-off-by: NGeliang Tang <geliangtang@163.com>
Acked-by: NChristoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d8ad47d8
......@@ -3338,17 +3338,12 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac)
#if STATS
{
int i = 0;
struct list_head *p;
p = n->slabs_free.next;
while (p != &(n->slabs_free)) {
struct page *page;
struct page *page;
page = list_entry(p, struct page, lru);
list_for_each_entry(page, &n->slabs_free, lru) {
BUG_ON(page->active);
i++;
p = p->next;
}
STATS_SET_FREEABLE(cachep, i);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册