{
unsigned long start = round_up(*vm_end, size);
unsigned long end = (start | ~mask) + 1;
+ VMA_ITERATOR(vmi, args->mm, start);
VM_WARN_ON_ONCE(mask & size);
VM_WARN_ON_ONCE((start & mask) != (*vm_start & mask));
- while (args->vma) {
- if (start >= args->vma->vm_end) {
- args->vma = args->vma->vm_next;
- continue;
- }
-
+ for_each_vma(vmi, args->vma) {
if (end && end <= args->vma->vm_start)
return false;
- if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args)) {
- args->vma = args->vma->vm_next;
+ if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args))
continue;
- }
*vm_start = max(start, args->vma->vm_start);
*vm_end = min(end - 1, args->vma->vm_end - 1) + 1;