diff --git a/mm/mlock.c b/mm/mlock.c index cde076fa7d5e..817ff7737e52 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "internal.h" @@ -518,8 +519,8 @@ static int apply_vma_lock_flags(unsigned long start, size_t len, struct vm_area_struct *vma, *prev; VMA_ITERATOR(vmi, current->mm, start); - VM_BUG_ON(offset_in_page(start)); - VM_BUG_ON(len != PAGE_ALIGN(len)); + VM_BUG_ON(__offset_in_page_log(start)); + VM_BUG_ON(len != __PAGE_ALIGN(len)); end = start + len; if (end < start) return -EINVAL; @@ -620,8 +621,8 @@ static __must_check int do_mlock(unsigned long start, size_t len, vm_flags_t fla if (!can_do_mlock()) return -EPERM; - len = PAGE_ALIGN(len + (offset_in_page(start))); - start &= PAGE_MASK; + len = __PAGE_ALIGN(len + (__offset_in_page(start))); + start &= __PAGE_MASK; lock_limit = rlimit(RLIMIT_MEMLOCK); lock_limit >>= PAGE_SHIFT; @@ -680,8 +681,8 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) start = untagged_addr(start); - len = PAGE_ALIGN(len + (offset_in_page(start))); - start &= PAGE_MASK; + len = __PAGE_ALIGN(len + (__offset_in_page(start))); + start &= __PAGE_MASK; if (mmap_write_lock_killable(current->mm)) return -EINTR;