]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/mmap.c: replace find_vma_prepare() with clearer find_vma_links()
authorHugh Dickins <hughd@google.com>
Fri, 28 Sep 2012 00:19:08 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Oct 2012 05:03:11 +0000 (15:03 +1000)
commit12fcb3d5bfc77eddd66d16f14603789df9ebabc7
tree9805c44c77304c54d7c2a9340b2de1e3d97f6839
parent7815688a4af17361d694c5844a8e81f90e80c1ce
mm/mmap.c: replace find_vma_prepare() with clearer find_vma_links()

People get confused by find_vma_prepare(), because it doesn't care about
what it returns in its output args, when its callers won't be interested.

Clarify by passing in end-of-range address too, and returning failure if
any existing vma overlaps the new range: instead of returning an ambiguous
vma which most callers then must check.  find_vma_links() is a clearer
name.

This does revert 2.6.27's dfe195fb79e88 ("mm: fix uninitialized variables
for find_vma_prepare callers"), but it looks like gcc 4.3.0 was one of
those releases too eager to shout about uninitialized variables: only
copy_vma() warns with 4.5.1 and 4.7.1, which a BUG on error silences.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Benny Halevy <bhalevy@tonian.com>
Acked-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c