diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -894,14 +894,11 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, | |||
894 | unsigned long flags, unsigned long pgoff) | 894 | unsigned long flags, unsigned long pgoff) |
895 | { | 895 | { |
896 | struct mm_struct * mm = current->mm; | 896 | struct mm_struct * mm = current->mm; |
897 | struct vm_area_struct * vma, * prev; | ||
898 | struct inode *inode; | 897 | struct inode *inode; |
899 | unsigned int vm_flags; | 898 | unsigned int vm_flags; |
900 | int correct_wcount = 0; | ||
901 | int error; | 899 | int error; |
902 | struct rb_node ** rb_link, * rb_parent; | ||
903 | int accountable = 1; | 900 | int accountable = 1; |
904 | unsigned long charged = 0, reqprot = prot; | 901 | unsigned long reqprot = prot; |
905 | 902 | ||
906 | /* | 903 | /* |
907 | * Does the application expect PROT_READ to imply PROT_EXEC? | 904 | * Does the application expect PROT_READ to imply PROT_EXEC? |
@@ -1027,6 +1024,24 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, | |||
1027 | if (error) | 1024 | if (error) |
1028 | return error; | 1025 | return error; |
1029 | 1026 | ||
1027 | return mmap_region(file, addr, len, flags, vm_flags, pgoff, | ||
1028 | accountable); | ||
1029 | } | ||
1030 | EXPORT_SYMBOL(do_mmap_pgoff); | ||
1031 | |||
1032 | unsigned long mmap_region(struct file *file, unsigned long addr, | ||
1033 | unsigned long len, unsigned long flags, | ||
1034 | unsigned int vm_flags, unsigned long pgoff, | ||
1035 | int accountable) | ||
1036 | { | ||
1037 | struct mm_struct *mm = current->mm; | ||
1038 | struct vm_area_struct *vma, *prev; | ||
1039 | int correct_wcount = 0; | ||
1040 | int error; | ||
1041 | struct rb_node **rb_link, *rb_parent; | ||
1042 | unsigned long charged = 0; | ||
1043 | struct inode *inode = file ? file->f_path.dentry->d_inode : NULL; | ||
1044 | |||
1030 | /* Clear old maps */ | 1045 | /* Clear old maps */ |
1031 | error = -ENOMEM; | 1046 | error = -ENOMEM; |
1032 | munmap_back: | 1047 | munmap_back: |
@@ -1175,8 +1190,6 @@ unacct_error: | |||
1175 | return error; | 1190 | return error; |
1176 | } | 1191 | } |
1177 | 1192 | ||
1178 | EXPORT_SYMBOL(do_mmap_pgoff); | ||
1179 | |||
1180 | /* Get an address range which is currently unmapped. | 1193 | /* Get an address range which is currently unmapped. |
1181 | * For shmat() with addr=0. | 1194 | * For shmat() with addr=0. |
1182 | * | 1195 | * |