Commit 7ae12a57 authored by Hongbo Li's avatar Hongbo Li Committed by Andrew Morton

mm/vmalloc.c: make use of the helper macro LIST_HEAD()

list_head can be initialized automatically with LIST_HEAD() instead of
calling INIT_LIST_HEAD().  Here we can simplify the code.

Link: https://lkml.kernel.org/r/20240828041216.1222582-1-lihongbo22@huawei.comSigned-off-by: default avatarHongbo Li <lihongbo22@huawei.com>
Reviewed-by: default avatarUladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 81d3ff3c
...@@ -2131,23 +2131,18 @@ reclaim_list_global(struct list_head *head) ...@@ -2131,23 +2131,18 @@ reclaim_list_global(struct list_head *head)
static void static void
decay_va_pool_node(struct vmap_node *vn, bool full_decay) decay_va_pool_node(struct vmap_node *vn, bool full_decay)
{ {
LIST_HEAD(decay_list);
struct rb_root decay_root = RB_ROOT;
struct vmap_area *va, *nva; struct vmap_area *va, *nva;
struct list_head decay_list;
struct rb_root decay_root;
unsigned long n_decay; unsigned long n_decay;
int i; int i;
decay_root = RB_ROOT;
INIT_LIST_HEAD(&decay_list);
for (i = 0; i < MAX_VA_SIZE_PAGES; i++) { for (i = 0; i < MAX_VA_SIZE_PAGES; i++) {
struct list_head tmp_list; LIST_HEAD(tmp_list);
if (list_empty(&vn->pool[i].head)) if (list_empty(&vn->pool[i].head))
continue; continue;
INIT_LIST_HEAD(&tmp_list);
/* Detach the pool, so no-one can access it. */ /* Detach the pool, so no-one can access it. */
spin_lock(&vn->pool_lock); spin_lock(&vn->pool_lock);
list_replace_init(&vn->pool[i].head, &tmp_list); list_replace_init(&vn->pool[i].head, &tmp_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment