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.h57
1 files changed, 50 insertions, 7 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 29f02d8513f6..bc01fff3aa01 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -163,7 +163,7 @@ extern unsigned int kobjsize(const void *objp);
163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ 165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
166#define VM_INCOMPLETE 0x02000000 /* Strange partial PFN mapping marker */ 166#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
167 167
168#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 168#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
169#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 169#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
@@ -634,14 +634,38 @@ struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
634int shmem_lock(struct file *file, int lock, struct user_struct *user); 634int shmem_lock(struct file *file, int lock, struct user_struct *user);
635#else 635#else
636#define shmem_nopage filemap_nopage 636#define shmem_nopage filemap_nopage
637#define shmem_lock(a, b, c) ({0;}) /* always in memory, no need to lock */ 637
638#define shmem_set_policy(a, b) (0) 638static inline int shmem_lock(struct file *file, int lock,
639#define shmem_get_policy(a, b) (NULL) 639 struct user_struct *user)
640{
641 return 0;
642}
643
644static inline int shmem_set_policy(struct vm_area_struct *vma,
645 struct mempolicy *new)
646{
647 return 0;
648}
649
650static inline struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
651 unsigned long addr)
652{
653 return NULL;
654}
640#endif 655#endif
641struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); 656struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags);
657extern int shmem_mmap(struct file *file, struct vm_area_struct *vma);
642 658
643int shmem_zero_setup(struct vm_area_struct *); 659int shmem_zero_setup(struct vm_area_struct *);
644 660
661#ifndef CONFIG_MMU
662extern unsigned long shmem_get_unmapped_area(struct file *file,
663 unsigned long addr,
664 unsigned long len,
665 unsigned long pgoff,
666 unsigned long flags);
667#endif
668
645static inline int can_do_mlock(void) 669static inline int can_do_mlock(void)
646{ 670{
647 if (capable(CAP_IPC_LOCK)) 671 if (capable(CAP_IPC_LOCK))
@@ -690,14 +714,31 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
690} 714}
691 715
692extern int vmtruncate(struct inode * inode, loff_t offset); 716extern int vmtruncate(struct inode * inode, loff_t offset);
717extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end);
693extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); 718extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
694extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); 719extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
695extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
696 720
697static inline int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) 721#ifdef CONFIG_MMU
722extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma,
723 unsigned long address, int write_access);
724
725static inline int handle_mm_fault(struct mm_struct *mm,
726 struct vm_area_struct *vma, unsigned long address,
727 int write_access)
698{ 728{
699 return __handle_mm_fault(mm, vma, address, write_access) & (~VM_FAULT_WRITE); 729 return __handle_mm_fault(mm, vma, address, write_access) &
730 (~VM_FAULT_WRITE);
700} 731}
732#else
733static inline int handle_mm_fault(struct mm_struct *mm,
734 struct vm_area_struct *vma, unsigned long address,
735 int write_access)
736{
737 /* should never happen if there's no MMU */
738 BUG();
739 return VM_FAULT_SIGBUS;
740}
741#endif
701 742
702extern int make_pages_present(unsigned long addr, unsigned long end); 743extern int make_pages_present(unsigned long addr, unsigned long end);
703extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 744extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
@@ -896,6 +937,8 @@ extern unsigned long do_brk(unsigned long, unsigned long);
896/* filemap.c */ 937/* filemap.c */
897extern unsigned long page_unuse(struct page *); 938extern unsigned long page_unuse(struct page *);
898extern void truncate_inode_pages(struct address_space *, loff_t); 939extern void truncate_inode_pages(struct address_space *, loff_t);
940extern void truncate_inode_pages_range(struct address_space *,
941 loff_t lstart, loff_t lend);
899 942
900/* generic vm_area_ops exported for stackable file systems */ 943/* generic vm_area_ops exported for stackable file systems */
901extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); 944extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *);