aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c2
-rw-r--r--mm/tiny-shmem.c1
-rw-r--r--mm/vmalloc.c19
3 files changed, 17 insertions, 5 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 3a6c4a658325..164951c47305 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -64,8 +64,6 @@
64 64
65#include "internal.h" 65#include "internal.h"
66 66
67#include "internal.h"
68
69#ifndef CONFIG_NEED_MULTIPLE_NODES 67#ifndef CONFIG_NEED_MULTIPLE_NODES
70/* use the per-pgdat data instead for discontigmem - mbligh */ 68/* use the per-pgdat data instead for discontigmem - mbligh */
71unsigned long max_mapnr; 69unsigned long max_mapnr;
diff --git a/mm/tiny-shmem.c b/mm/tiny-shmem.c
index 8d7a27a6335c..3e67d575ee6e 100644
--- a/mm/tiny-shmem.c
+++ b/mm/tiny-shmem.c
@@ -95,6 +95,7 @@ put_dentry:
95put_memory: 95put_memory:
96 return ERR_PTR(error); 96 return ERR_PTR(error);
97} 97}
98EXPORT_SYMBOL_GPL(shmem_file_setup);
98 99
99/** 100/**
100 * shmem_zero_setup - setup a shared anonymous mapping 101 * shmem_zero_setup - setup a shared anonymous mapping
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 712ae47af0bf..65ae576030da 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -17,7 +17,6 @@
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/seq_file.h> 18#include <linux/seq_file.h>
19#include <linux/debugobjects.h> 19#include <linux/debugobjects.h>
20#include <linux/vmalloc.h>
21#include <linux/kallsyms.h> 20#include <linux/kallsyms.h>
22#include <linux/list.h> 21#include <linux/list.h>
23#include <linux/rbtree.h> 22#include <linux/rbtree.h>
@@ -175,6 +174,21 @@ static int vmap_page_range(unsigned long addr, unsigned long end,
175 return nr; 174 return nr;
176} 175}
177 176
177static inline int is_vmalloc_or_module_addr(const void *x)
178{
179 /*
180 * x86-64 and sparc64 put modules in a special place,
181 * and fall back on vmalloc() if that fails. Others
182 * just put it in the vmalloc space.
183 */
184#if defined(CONFIG_MODULES) && defined(MODULES_VADDR)
185 unsigned long addr = (unsigned long)x;
186 if (addr >= MODULES_VADDR && addr < MODULES_END)
187 return 1;
188#endif
189 return is_vmalloc_addr(x);
190}
191
178/* 192/*
179 * Walk a vmap address to the struct page it maps. 193 * Walk a vmap address to the struct page it maps.
180 */ 194 */
@@ -188,8 +202,7 @@ struct page *vmalloc_to_page(const void *vmalloc_addr)
188 * XXX we might need to change this if we add VIRTUAL_BUG_ON for 202 * XXX we might need to change this if we add VIRTUAL_BUG_ON for
189 * architectures that do not vmalloc module space 203 * architectures that do not vmalloc module space
190 */ 204 */
191 VIRTUAL_BUG_ON(!is_vmalloc_addr(vmalloc_addr) && 205 VIRTUAL_BUG_ON(!is_vmalloc_or_module_addr(vmalloc_addr));
192 !is_module_address(addr));
193 206
194 if (!pgd_none(*pgd)) { 207 if (!pgd_none(*pgd)) {
195 pud_t *pud = pud_offset(pgd, addr); 208 pud_t *pud = pud_offset(pgd, addr);