aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-01-15 20:01:34 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-16 15:15:40 -0500
commit779c10232ceb11c1b259232c4845cfb2850287b7 (patch)
tree972b07acdcff03b20c84d42425a64b231df52aaa /mm
parent1e2ae599d37e60958c03ca5e46b1f657619a30cd (diff)
nommu: remove a superfluous check of vm_region::vm_usage
In split_vma(), there's no need to check if the VMA being split has a region that's in use by more than one VMA because: (1) The preceding test prohibits splitting of non-anonymous VMAs and regions (eg: file or chardev backed VMAs). (2) Anonymous regions can't be mapped multiple times because there's no handle by which to refer to the already existing region. (3) If a VMA has previously been split, then the region backing it has also been split into two regions, each of usage 1. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Greg Ungerer <gerg@snapgear.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/nommu.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index 5e39294f8ea8..d6dd656264a2 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1441,10 +1441,9 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
1441 1441
1442 kenter(""); 1442 kenter("");
1443 1443
1444 /* we're only permitted to split anonymous regions that have a single 1444 /* we're only permitted to split anonymous regions (these should have
1445 * owner */ 1445 * only a single usage on the region) */
1446 if (vma->vm_file || 1446 if (vma->vm_file)
1447 vma->vm_region->vm_usage != 1)
1448 return -ENOMEM; 1447 return -ENOMEM;
1449 1448
1450 if (mm->map_count >= sysctl_max_map_count) 1449 if (mm->map_count >= sysctl_max_map_count)