Skip to content

Commit

Permalink
mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_contin…
Browse files Browse the repository at this point in the history
…uations

Use list_for_each_entry_safe() instead of list_for_each_safe() to
simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Geliang Tang authored and Linus Torvalds committed Jan 15, 2016
1 parent 0e41e27 commit 0d576d2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mm/swapfile.c
Original file line number Diff line number Diff line change
@@ -2953,11 +2953,10 @@ static void free_swap_count_continuations(struct swap_info_struct *si)
struct page *head;
head = vmalloc_to_page(si->swap_map + offset);
if (page_private(head)) {
struct list_head *this, *next;
list_for_each_safe(this, next, &head->lru) {
struct page *page;
page = list_entry(this, struct page, lru);
list_del(this);
struct page *page, *next;

list_for_each_entry_safe(page, next, &head->lru, lru) {
list_del(&page->lru);
__free_page(page);
}
}

0 comments on commit 0d576d2

Please sign in to comment.