aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64/pgalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86_64/pgalloc.h')
-rw-r--r--include/asm-x86_64/pgalloc.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h
index 31d497171969..8bb564687860 100644
--- a/include/asm-x86_64/pgalloc.h
+++ b/include/asm-x86_64/pgalloc.h
@@ -44,24 +44,16 @@ static inline void pgd_list_add(pgd_t *pgd)
44 struct page *page = virt_to_page(pgd); 44 struct page *page = virt_to_page(pgd);
45 45
46 spin_lock(&pgd_lock); 46 spin_lock(&pgd_lock);
47 page->index = (pgoff_t)pgd_list; 47 list_add(&page->lru, &pgd_list);
48 if (pgd_list)
49 pgd_list->private = (unsigned long)&page->index;
50 pgd_list = page;
51 page->private = (unsigned long)&pgd_list;
52 spin_unlock(&pgd_lock); 48 spin_unlock(&pgd_lock);
53} 49}
54 50
55static inline void pgd_list_del(pgd_t *pgd) 51static inline void pgd_list_del(pgd_t *pgd)
56{ 52{
57 struct page *next, **pprev, *page = virt_to_page(pgd); 53 struct page *page = virt_to_page(pgd);
58 54
59 spin_lock(&pgd_lock); 55 spin_lock(&pgd_lock);
60 next = (struct page *)page->index; 56 list_del(&page->lru);
61 pprev = (struct page **)page->private;
62 *pprev = next;
63 if (next)
64 next->private = (unsigned long)pprev;
65 spin_unlock(&pgd_lock); 57 spin_unlock(&pgd_lock);
66} 58}
67 59