mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations
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>
This commit is contained in:
parent
0e41e27797
commit
0d576d20cc
1 changed files with 4 additions and 5 deletions
|
@ -2953,11 +2953,10 @@ static void free_swap_count_continuations(struct swap_info_struct *si)
|
||||||
struct page *head;
|
struct page *head;
|
||||||
head = vmalloc_to_page(si->swap_map + offset);
|
head = vmalloc_to_page(si->swap_map + offset);
|
||||||
if (page_private(head)) {
|
if (page_private(head)) {
|
||||||
struct list_head *this, *next;
|
struct page *page, *next;
|
||||||
list_for_each_safe(this, next, &head->lru) {
|
|
||||||
struct page *page;
|
list_for_each_entry_safe(page, next, &head->lru, lru) {
|
||||||
page = list_entry(this, struct page, lru);
|
list_del(&page->lru);
|
||||||
list_del(this);
|
|
||||||
__free_page(page);
|
__free_page(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue