提交 894e58c1 编写于 作者: B Byungchul Park 提交者: Linus Torvalds

mm/vmalloc.c: don't reinvent the wheel but use existing llist API

Although llist provides proper APIs, they are not used.  Make them used.

Link: http://lkml.kernel.org/r/1502095374-16112-1-git-send-email-byungchul.park@lge.comSigned-off-by: NByungchul Park <byungchul.park@lge.com>
Cc: zijun_hu <zijun_hu@htc.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f113e641
...@@ -49,12 +49,10 @@ static void __vunmap(const void *, int); ...@@ -49,12 +49,10 @@ static void __vunmap(const void *, int);
static void free_work(struct work_struct *w) static void free_work(struct work_struct *w)
{ {
struct vfree_deferred *p = container_of(w, struct vfree_deferred, wq); struct vfree_deferred *p = container_of(w, struct vfree_deferred, wq);
struct llist_node *llnode = llist_del_all(&p->list); struct llist_node *t, *llnode;
while (llnode) {
void *p = llnode; llist_for_each_safe(llnode, t, llist_del_all(&p->list))
llnode = llist_next(llnode); __vunmap((void *)llnode, 1);
__vunmap(p, 1);
}
} }
/*** Page table manipulation functions ***/ /*** Page table manipulation functions ***/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册