diff options
Diffstat (limited to 'include/linux/mm.h')
| -rw-r--r-- | include/linux/mm.h | 27 | 
1 files changed, 15 insertions, 12 deletions
| diff --git a/include/linux/mm.h b/include/linux/mm.h index eef34f6a0351..2dd73e4f3d8e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -377,7 +377,7 @@ extern unsigned int kobjsize(const void *objp);  #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */  /* Bits set in the VMA until the stack is in its final location */ -#define VM_STACK_INCOMPLETE_SETUP	(VM_RAND_READ | VM_SEQ_READ) +#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY)  #define TASK_EXEC ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) @@ -399,8 +399,10 @@ extern unsigned int kobjsize(const void *objp);  #ifdef CONFIG_STACK_GROWSUP  #define VM_STACK	VM_GROWSUP +#define VM_STACK_EARLY	VM_GROWSDOWN  #else  #define VM_STACK	VM_GROWSDOWN +#define VM_STACK_EARLY	0  #endif  #define VM_STACK_FLAGS	(VM_STACK | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) @@ -2323,6 +2325,9 @@ void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to);  void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);  int generic_error_remove_page(struct address_space *mapping, struct page *page); +struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, +		unsigned long address, struct pt_regs *regs); +  #ifdef CONFIG_MMU  extern vm_fault_t handle_mm_fault(struct vm_area_struct *vma,  				  unsigned long address, unsigned int flags, @@ -3174,7 +3179,7 @@ extern unsigned long do_mmap(struct file *file, unsigned long addr,  	unsigned long pgoff, unsigned long *populate, struct list_head *uf);  extern int do_vmi_munmap(struct vma_iterator *vmi, struct mm_struct *mm,  			 unsigned long start, size_t len, struct list_head *uf, -			 bool downgrade); +			 bool unlock);  extern int do_munmap(struct mm_struct *, unsigned long, size_t,  		     struct list_head *uf);  extern int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int behavior); @@ -3182,7 +3187,7 @@ extern int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in,  #ifdef CONFIG_MMU  extern int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,  			 unsigned long start, unsigned long end, -			 struct list_head *uf, bool downgrade); +			 struct list_head *uf, bool unlock);  extern int __mm_populate(unsigned long addr, unsigned long len,  			 int ignore_errors);  static inline void mm_populate(unsigned long addr, unsigned long len) @@ -3228,16 +3233,11 @@ extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf);  extern unsigned long stack_guard_gap;  /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ -extern int expand_stack(struct vm_area_struct *vma, unsigned long address); +int expand_stack_locked(struct vm_area_struct *vma, unsigned long address); +struct vm_area_struct *expand_stack(struct mm_struct * mm, unsigned long addr);  /* CONFIG_STACK_GROWSUP still needs to grow downwards at some places */ -extern int expand_downwards(struct vm_area_struct *vma, -		unsigned long address); -#if VM_GROWSUP -extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); -#else -  #define expand_upwards(vma, address) (0) -#endif +int expand_downwards(struct vm_area_struct *vma, unsigned long address);  /* Look up the first VMA which satisfies  addr < vm_end,  NULL if none. */  extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); @@ -3332,7 +3332,8 @@ unsigned long change_prot_numa(struct vm_area_struct *vma,  			unsigned long start, unsigned long end);  #endif -struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); +struct vm_area_struct *find_extend_vma_locked(struct mm_struct *, +		unsigned long addr);  int remap_pfn_range(struct vm_area_struct *, unsigned long addr,  			unsigned long pfn, unsigned long size, pgprot_t);  int remap_pfn_range_notrack(struct vm_area_struct *vma, unsigned long addr, @@ -3380,6 +3381,8 @@ static inline vm_fault_t vmf_error(int err)  {  	if (err == -ENOMEM)  		return VM_FAULT_OOM; +	else if (err == -EHWPOISON) +		return VM_FAULT_HWPOISON;  	return VM_FAULT_SIGBUS;  } |