aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r--include/asm-x86_64/pgalloc.h14
-rw-r--r--include/asm-x86_64/pgtable.h2
2 files changed, 4 insertions, 12 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
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index c1865e38c7b7..599993f6ba84 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -410,7 +410,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
410#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 410#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
411 411
412extern spinlock_t pgd_lock; 412extern spinlock_t pgd_lock;
413extern struct page *pgd_list; 413extern struct list_head pgd_list;
414void vmalloc_sync_all(void); 414void vmalloc_sync_all(void);
415 415
416extern int kern_addr_valid(unsigned long addr); 416extern int kern_addr_valid(unsigned long addr);