Commit c561259c authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Linus Torvalds

mm: move gup() -> posix mlock() error conversion out of __mm_populate

This is praparation to moving mm_populate()-related code out of
Signed-off-by: 's avatarKirill A. Shutemov <>
Acked-by: 's avatarLinus Torvalds <>
Acked-by: 's avatarDavid Rientjes <>
Cc: Michel Lespinasse <>
Cc: Rik van Riel <>
Signed-off-by: 's avatarAndrew Morton <>
Signed-off-by: 's avatarLinus Torvalds <>
parent fc05f566
......@@ -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);
nend = nstart + ret * PAGE_SIZE;
......@@ -750,9 +749,13 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
error = do_mlock(start, len, 1);
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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment