mm/mmap.c: add mlock_future_check() helper
authorDavidlohr Bueso <[email protected]>
Tue, 21 Jan 2014 23:49:15 +0000 (15:49 -0800)
committerLinus Torvalds <[email protected]>
Wed, 22 Jan 2014 00:19:44 +0000 (16:19 -0800)
commit363ee17f0f405faff74d9aaf93d21d5f41d5102d
tree4ff07b1b36a024b455467ac78e07fec6f18a6780
parent49f0ce5f92321cdcf741e35f385669a421013cb7
mm/mmap.c: add mlock_future_check() helper

Both do_brk and do_mmap_pgoff verify that we are actually capable of
locking future pages if the corresponding VM_LOCKED flags are used.
Encapsulate this logic into a single mlock_future_check() helper
function.

Signed-off-by: Davidlohr Bueso <[email protected]>
Cc: Rik van Riel <[email protected]>
Reviewed-by: Michel Lespinasse <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mmap.c