diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2015-04-15 01:44:42 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 02:49:00 +0300 |
commit | c561259ca79a88be540a75e84b45d49123014aa4 (patch) | |
tree | 4e5e814cc4353bc0410d1ae7aebb6ecb1034eb36 /mm/mlock.c | |
parent | fc05f566210fa57f8e68ead8762b8dbb3f1c61e3 (diff) | |
download | linux-c561259ca79a88be540a75e84b45d49123014aa4.tar.xz |
mm: move gup() -> posix mlock() error conversion out of __mm_populate
This is praparation to moving mm_populate()-related code out of
mm/mlock.c.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mlock.c')
-rw-r--r-- | mm/mlock.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/mlock.c b/mm/mlock.c index 9d0f3cd716c5..0214263fca45 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -712,7 +712,6 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors) ret = 0; continue; /* continue at next VMA */ } - ret = __mlock_posix_error_return(ret); break; } nend = nstart + ret * PAGE_SIZE; @@ -750,9 +749,13 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) error = do_mlock(start, len, 1); up_write(¤t->mm->mmap_sem); - if (!error) - error = __mm_populate(start, len, 0); - return error; + if (error) + return error; + + error = __mm_populate(start, len, 0); + if (error) + return __mlock_posix_error_return(error); + return 0; } SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) |