diff options
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e4f0db2a3eae..0fdf96803c5b 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -220,12 +220,12 @@ int is_vmalloc_or_module_addr(const void *x) | |||
220 | } | 220 | } |
221 | 221 | ||
222 | /* | 222 | /* |
223 | * Walk a vmap address to the physical pfn it maps to. | 223 | * Walk a vmap address to the struct page it maps. |
224 | */ | 224 | */ |
225 | unsigned long vmalloc_to_pfn(const void *vmalloc_addr) | 225 | struct page *vmalloc_to_page(const void *vmalloc_addr) |
226 | { | 226 | { |
227 | unsigned long addr = (unsigned long) vmalloc_addr; | 227 | unsigned long addr = (unsigned long) vmalloc_addr; |
228 | unsigned long pfn = 0; | 228 | struct page *page = NULL; |
229 | pgd_t *pgd = pgd_offset_k(addr); | 229 | pgd_t *pgd = pgd_offset_k(addr); |
230 | 230 | ||
231 | /* | 231 | /* |
@@ -244,23 +244,23 @@ unsigned long vmalloc_to_pfn(const void *vmalloc_addr) | |||
244 | ptep = pte_offset_map(pmd, addr); | 244 | ptep = pte_offset_map(pmd, addr); |
245 | pte = *ptep; | 245 | pte = *ptep; |
246 | if (pte_present(pte)) | 246 | if (pte_present(pte)) |
247 | pfn = pte_pfn(pte); | 247 | page = pte_page(pte); |
248 | pte_unmap(ptep); | 248 | pte_unmap(ptep); |
249 | } | 249 | } |
250 | } | 250 | } |
251 | } | 251 | } |
252 | return pfn; | 252 | return page; |
253 | } | 253 | } |
254 | EXPORT_SYMBOL(vmalloc_to_pfn); | 254 | EXPORT_SYMBOL(vmalloc_to_page); |
255 | 255 | ||
256 | /* | 256 | /* |
257 | * Map a vmalloc()-space virtual address to the struct page. | 257 | * Map a vmalloc()-space virtual address to the physical page frame number. |
258 | */ | 258 | */ |
259 | struct page *vmalloc_to_page(const void *vmalloc_addr) | 259 | unsigned long vmalloc_to_pfn(const void *vmalloc_addr) |
260 | { | 260 | { |
261 | return pfn_to_page(vmalloc_to_pfn(vmalloc_addr)); | 261 | return page_to_pfn(vmalloc_to_page(vmalloc_addr)); |
262 | } | 262 | } |
263 | EXPORT_SYMBOL(vmalloc_to_page); | 263 | EXPORT_SYMBOL(vmalloc_to_pfn); |
264 | 264 | ||
265 | 265 | ||
266 | /*** Global kva allocator ***/ | 266 | /*** Global kva allocator ***/ |