aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 6c997b1596..47556d2b3e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -13,6 +13,7 @@
13#include <linux/pagemap.h> 13#include <linux/pagemap.h>
14#include <linux/swap.h> 14#include <linux/swap.h>
15#include <linux/syscalls.h> 15#include <linux/syscalls.h>
16#include <linux/capability.h>
16#include <linux/init.h> 17#include <linux/init.h>
17#include <linux/file.h> 18#include <linux/file.h>
18#include <linux/fs.h> 19#include <linux/fs.h>
@@ -611,7 +612,7 @@ again: remove_next = 1 + (end > next->vm_end);
611 * If the vma has a ->close operation then the driver probably needs to release 612 * If the vma has a ->close operation then the driver probably needs to release
612 * per-vma resources, so we don't attempt to merge those. 613 * per-vma resources, so we don't attempt to merge those.
613 */ 614 */
614#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED) 615#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP)
615 616
616static inline int is_mergeable_vma(struct vm_area_struct *vma, 617static inline int is_mergeable_vma(struct vm_area_struct *vma,
617 struct file *file, unsigned long vm_flags) 618 struct file *file, unsigned long vm_flags)
@@ -1076,17 +1077,6 @@ munmap_back:
1076 error = file->f_op->mmap(file, vma); 1077 error = file->f_op->mmap(file, vma);
1077 if (error) 1078 if (error)
1078 goto unmap_and_free_vma; 1079 goto unmap_and_free_vma;
1079 if ((vma->vm_flags & (VM_SHARED | VM_WRITE | VM_RESERVED))
1080 == (VM_WRITE | VM_RESERVED)) {
1081 printk(KERN_WARNING "program %s is using MAP_PRIVATE, "
1082 "PROT_WRITE mmap of VM_RESERVED memory, which "
1083 "is deprecated. Please report this to "
1084 "linux-kernel@vger.kernel.org\n",current->comm);
1085 if (vma->vm_ops && vma->vm_ops->close)
1086 vma->vm_ops->close(vma);
1087 error = -EACCES;
1088 goto unmap_and_free_vma;
1089 }
1090 } else if (vm_flags & VM_SHARED) { 1080 } else if (vm_flags & VM_SHARED) {
1091 error = shmem_zero_setup(vma); 1081 error = shmem_zero_setup(vma);
1092 if (error) 1082 if (error)
@@ -1501,7 +1491,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
1501 * PA-RISC uses this for its stack; IA64 for its Register Backing Store. 1491 * PA-RISC uses this for its stack; IA64 for its Register Backing Store.
1502 * vma is the last one with address > vma->vm_end. Have to extend vma. 1492 * vma is the last one with address > vma->vm_end. Have to extend vma.
1503 */ 1493 */
1504#ifdef CONFIG_STACK_GROWSUP 1494#ifndef CONFIG_IA64
1505static inline 1495static inline
1506#endif 1496#endif
1507int expand_upwards(struct vm_area_struct *vma, unsigned long address) 1497int expand_upwards(struct vm_area_struct *vma, unsigned long address)