diff options
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/mmap.c | 6 | ||||
| -rw-r--r-- | mm/nommu.c | 2 |
2 files changed, 4 insertions, 4 deletions
| @@ -93,7 +93,7 @@ atomic_t vm_committed_space = ATOMIC_INIT(0); | |||
| 93 | * Note this is a helper function intended to be used by LSMs which | 93 | * Note this is a helper function intended to be used by LSMs which |
| 94 | * wish to use this logic. | 94 | * wish to use this logic. |
| 95 | */ | 95 | */ |
| 96 | int __vm_enough_memory(long pages, int cap_sys_admin) | 96 | int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) |
| 97 | { | 97 | { |
| 98 | unsigned long free, allowed; | 98 | unsigned long free, allowed; |
| 99 | 99 | ||
| @@ -166,7 +166,7 @@ int __vm_enough_memory(long pages, int cap_sys_admin) | |||
| 166 | 166 | ||
| 167 | /* Don't let a single process grow too big: | 167 | /* Don't let a single process grow too big: |
| 168 | leave 3% of the size of this process for other processes */ | 168 | leave 3% of the size of this process for other processes */ |
| 169 | allowed -= current->mm->total_vm / 32; | 169 | allowed -= mm->total_vm / 32; |
| 170 | 170 | ||
| 171 | /* | 171 | /* |
| 172 | * cast `allowed' as a signed long because vm_committed_space | 172 | * cast `allowed' as a signed long because vm_committed_space |
| @@ -2077,7 +2077,7 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) | |||
| 2077 | if (__vma && __vma->vm_start < vma->vm_end) | 2077 | if (__vma && __vma->vm_start < vma->vm_end) |
| 2078 | return -ENOMEM; | 2078 | return -ENOMEM; |
| 2079 | if ((vma->vm_flags & VM_ACCOUNT) && | 2079 | if ((vma->vm_flags & VM_ACCOUNT) && |
| 2080 | security_vm_enough_memory(vma_pages(vma))) | 2080 | security_vm_enough_memory_mm(mm, vma_pages(vma))) |
| 2081 | return -ENOMEM; | 2081 | return -ENOMEM; |
| 2082 | vma_link(mm, vma, prev, rb_link, rb_parent); | 2082 | vma_link(mm, vma, prev, rb_link, rb_parent); |
| 2083 | return 0; | 2083 | return 0; |
diff --git a/mm/nommu.c b/mm/nommu.c index 9eef6a398555..8ed0cb43118a 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
| @@ -1270,7 +1270,7 @@ EXPORT_SYMBOL(get_unmapped_area); | |||
| 1270 | * Note this is a helper function intended to be used by LSMs which | 1270 | * Note this is a helper function intended to be used by LSMs which |
| 1271 | * wish to use this logic. | 1271 | * wish to use this logic. |
| 1272 | */ | 1272 | */ |
| 1273 | int __vm_enough_memory(long pages, int cap_sys_admin) | 1273 | int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) |
| 1274 | { | 1274 | { |
| 1275 | unsigned long free, allowed; | 1275 | unsigned long free, allowed; |
| 1276 | 1276 | ||
