aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1ffca03f34b7..6953a5a53e44 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -25,6 +25,7 @@ extern unsigned long max_mapnr;
25#endif 25#endif
26 26
27extern unsigned long num_physpages; 27extern unsigned long num_physpages;
28extern unsigned long totalram_pages;
28extern void * high_memory; 29extern void * high_memory;
29extern int page_cluster; 30extern int page_cluster;
30 31
@@ -103,6 +104,7 @@ extern unsigned int kobjsize(const void *objp);
103#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ 104#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
104#define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ 105#define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */
105#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ 106#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */
107#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
106 108
107#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 109#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
108#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 110#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
@@ -283,6 +285,14 @@ static inline int is_vmalloc_addr(const void *x)
283 return 0; 285 return 0;
284#endif 286#endif
285} 287}
288#ifdef CONFIG_MMU
289extern int is_vmalloc_or_module_addr(const void *x);
290#else
291static int is_vmalloc_or_module_addr(const void *x)
292{
293 return 0;
294}
295#endif
286 296
287static inline struct page *compound_head(struct page *page) 297static inline struct page *compound_head(struct page *page)
288{ 298{
@@ -701,17 +711,8 @@ extern void pagefault_out_of_memory(void);
701 711
702extern void show_free_areas(void); 712extern void show_free_areas(void);
703 713
704#ifdef CONFIG_SHMEM 714int shmem_lock(struct file *file, int lock, struct user_struct *user);
705extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
706#else
707static inline int shmem_lock(struct file *file, int lock,
708 struct user_struct *user)
709{
710 return 0;
711}
712#endif
713struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); 715struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags);
714
715int shmem_zero_setup(struct vm_area_struct *); 716int shmem_zero_setup(struct vm_area_struct *);
716 717
717#ifndef CONFIG_MMU 718#ifndef CONFIG_MMU
@@ -821,6 +822,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
821 struct page **pages, struct vm_area_struct **vmas); 822 struct page **pages, struct vm_area_struct **vmas);
822int get_user_pages_fast(unsigned long start, int nr_pages, int write, 823int get_user_pages_fast(unsigned long start, int nr_pages, int write,
823 struct page **pages); 824 struct page **pages);
825struct page *get_dump_page(unsigned long addr);
824 826
825extern int try_to_release_page(struct page * page, gfp_t gfp_mask); 827extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
826extern void do_invalidatepage(struct page *page, unsigned long offset); 828extern void do_invalidatepage(struct page *page, unsigned long offset);
@@ -1064,6 +1066,8 @@ extern void setup_per_cpu_pageset(void);
1064static inline void setup_per_cpu_pageset(void) {} 1066static inline void setup_per_cpu_pageset(void) {}
1065#endif 1067#endif
1066 1068
1069extern void zone_pcp_update(struct zone *zone);
1070
1067/* nommu.c */ 1071/* nommu.c */
1068extern atomic_long_t mmap_pages_allocated; 1072extern atomic_long_t mmap_pages_allocated;
1069 1073
@@ -1232,7 +1236,8 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address,
1232#define FOLL_WRITE 0x01 /* check pte is writable */ 1236#define FOLL_WRITE 0x01 /* check pte is writable */
1233#define FOLL_TOUCH 0x02 /* mark page accessed */ 1237#define FOLL_TOUCH 0x02 /* mark page accessed */
1234#define FOLL_GET 0x04 /* do get_page on page */ 1238#define FOLL_GET 0x04 /* do get_page on page */
1235#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ 1239#define FOLL_DUMP 0x08 /* give error on hole if it would be zero */
1240#define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */
1236 1241
1237typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, 1242typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
1238 void *data); 1243 void *data);
@@ -1280,7 +1285,7 @@ int in_gate_area_no_task(unsigned long addr);
1280#define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) 1285#define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);})
1281#endif /* __HAVE_ARCH_GATE_AREA */ 1286#endif /* __HAVE_ARCH_GATE_AREA */
1282 1287
1283int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, 1288int drop_caches_sysctl_handler(struct ctl_table *, int,
1284 void __user *, size_t *, loff_t *); 1289 void __user *, size_t *, loff_t *);
1285unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, 1290unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
1286 unsigned long lru_pages); 1291 unsigned long lru_pages);