diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-12-26 08:14:54 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-01-21 03:04:02 +0300 |
commit | db08ca25253d56f1f76eb4b3fe32a7ac1fbab741 (patch) | |
tree | dbc1e5c53c3ad54c4841441c8bff13484d034f06 /mm/madvise.c | |
parent | 4840e418c2fc533d55ff6caa5b9313eed1d26cfd (diff) | |
download | linux-db08ca25253d56f1f76eb4b3fe32a7ac1fbab741.tar.xz |
mm: make do_madvise() available internally
This is in preparation for enabling this functionality through io_uring.
Add a helper that is just exporting what sys_madvise() does, and have the
system call use it.
No functional changes in this patch.
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'mm/madvise.c')
-rw-r--r-- | mm/madvise.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/madvise.c b/mm/madvise.c index bcdb6a042787..43b47d3fae02 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -1044,7 +1044,7 @@ madvise_behavior_valid(int behavior) * -EBADF - map exists, but area maps something that isn't a file. * -EAGAIN - a kernel resource was temporarily unavailable. */ -SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) +int do_madvise(unsigned long start, size_t len_in, int behavior) { unsigned long end, tmp; struct vm_area_struct *vma, *prev; @@ -1141,3 +1141,8 @@ out: return error; } + +SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) +{ + return do_madvise(start, len_in, behavior); +} |