vma = mm->mmap;
for (; vma ; vma = vma->vm_next) {
+ if (start >= vma->vm_end)
+ continue;
if (start + len <= vma->vm_start)
break;
- if (vma->vm_flags && VM_LOCKED) {
+ if (vma->vm_flags & VM_LOCKED) {
if (start > vma->vm_start)
count -= (start - vma->vm_start);
if (start + len < vma->vm_end) {
}
}
- return (PAGE_ALIGN(count) >> PAGE_SHIFT);
+ return count >> PAGE_SHIFT;
}
static __must_check int do_mlock(unsigned long start, size_t len, vm_flags_t flags)