diff --git a/include/linux/mm.h b/include/linux/mm.h index e969019306e41a91533b676c0cc483334da8df74..ae07b46923d47e448334d881cf02330d61bcc816 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2411,6 +2411,7 @@ extern unsigned long do_mmap(struct file *file, unsigned long addr, struct list_head *uf); extern int do_munmap(struct mm_struct *, unsigned long, size_t, struct list_head *uf); +extern int do_madvise(unsigned long start, size_t len_in, int behavior); static inline unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, diff --git a/mm/madvise.c b/mm/madvise.c index 519255997466cc36d647766e03ab4ac02cd6cb16..f6837ecc63208279ab0354ae14fa65a4d740f881 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -1082,7 +1082,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; @@ -1177,3 +1177,8 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) return error; } + +SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) +{ + return do_madvise(start, len_in, behavior); +}