diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-02-05 01:29:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:18 -0500 |
commit | 5e5419734c8719cbc01af959ad9c0844002c0df5 (patch) | |
tree | a075dca3f719946689efa0245464855cbf2a20ce /include/asm-x86/pgalloc_64.h | |
parent | 9f8f2172537de7af0b0fbd33502d18d52b1339bc (diff) |
add mm argument to pte/pmd/pud/pgd_free
(with Martin Schwidefsky <schwidefsky@de.ibm.com>)
The pgd/pud/pmd/pte page table allocation functions get a mm_struct pointer as
first argument. The free functions do not get the mm_struct argument. This
is 1) asymmetrical and 2) to do mm related page table allocations the mm
argument is needed on the free function as well.
[kamalesh@linux.vnet.ibm.com: i386 fix]
[akpm@linux-foundation.org: coding-syle fixes]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-x86/pgalloc_64.h')
-rw-r--r-- | include/asm-x86/pgalloc_64.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h index 8bb564687860..315314ce4bfb 100644 --- a/include/asm-x86/pgalloc_64.h +++ b/include/asm-x86/pgalloc_64.h | |||
@@ -17,7 +17,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
17 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); | 17 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); |
18 | } | 18 | } |
19 | 19 | ||
20 | static inline void pmd_free(pmd_t *pmd) | 20 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
21 | { | 21 | { |
22 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); | 22 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); |
23 | free_page((unsigned long)pmd); | 23 | free_page((unsigned long)pmd); |
@@ -33,7 +33,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
33 | return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); | 33 | return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline void pud_free (pud_t *pud) | 36 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
37 | { | 37 | { |
38 | BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); | 38 | BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); |
39 | free_page((unsigned long)pud); | 39 | free_page((unsigned long)pud); |
@@ -77,7 +77,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
77 | return pgd; | 77 | return pgd; |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline void pgd_free(pgd_t *pgd) | 80 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
81 | { | 81 | { |
82 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); | 82 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); |
83 | pgd_list_del(pgd); | 83 | pgd_list_del(pgd); |
@@ -100,13 +100,13 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
100 | /* Should really implement gc for free page table pages. This could be | 100 | /* Should really implement gc for free page table pages. This could be |
101 | done with a reference count in struct page. */ | 101 | done with a reference count in struct page. */ |
102 | 102 | ||
103 | static inline void pte_free_kernel(pte_t *pte) | 103 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
104 | { | 104 | { |
105 | BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); | 105 | BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); |
106 | free_page((unsigned long)pte); | 106 | free_page((unsigned long)pte); |
107 | } | 107 | } |
108 | 108 | ||
109 | static inline void pte_free(struct page *pte) | 109 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
110 | { | 110 | { |
111 | __free_page(pte); | 111 | __free_page(pte); |
112 | } | 112 | } |