diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2012-02-12 22:58:52 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2012-02-13 18:45:39 -0500 |
commit | 191c542442fdf53cc3c496c00be13367fd9cd42d (patch) | |
tree | 4aef9e33a1d99e6530b704243efbe373bb314d61 /mm/mmap.c | |
parent | bbd36568594d091e682a1975ef4ee41d808de0bc (diff) |
mm: collapse security_vm_enough_memory() variants into a single function
Collapse security_vm_enough_memory() variants into a single function.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1235,7 +1235,7 @@ munmap_back: | |||
1235 | */ | 1235 | */ |
1236 | if (accountable_mapping(file, vm_flags)) { | 1236 | if (accountable_mapping(file, vm_flags)) { |
1237 | charged = len >> PAGE_SHIFT; | 1237 | charged = len >> PAGE_SHIFT; |
1238 | if (security_vm_enough_memory(charged)) | 1238 | if (security_vm_enough_memory_mm(mm, charged)) |
1239 | return -ENOMEM; | 1239 | return -ENOMEM; |
1240 | vm_flags |= VM_ACCOUNT; | 1240 | vm_flags |= VM_ACCOUNT; |
1241 | } | 1241 | } |
@@ -2169,7 +2169,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len) | |||
2169 | if (mm->map_count > sysctl_max_map_count) | 2169 | if (mm->map_count > sysctl_max_map_count) |
2170 | return -ENOMEM; | 2170 | return -ENOMEM; |
2171 | 2171 | ||
2172 | if (security_vm_enough_memory(len >> PAGE_SHIFT)) | 2172 | if (security_vm_enough_memory_mm(mm, len >> PAGE_SHIFT)) |
2173 | return -ENOMEM; | 2173 | return -ENOMEM; |
2174 | 2174 | ||
2175 | /* Can we just expand an old private anonymous mapping? */ | 2175 | /* Can we just expand an old private anonymous mapping? */ |