if (mas_get_unmapped_area_rev(&mas, info->low_limit, info->high_limit,
length))
return -ENOMEM;
+
rcu_read_unlock();
- gap = mas.index;
- // Not sure why this is needed..
- if (mas.max > info->high_limit)
- gap = ((gap) & ~info->align_mask) + info->align_offset;
+ gap = (mas.index + info->align_mask - info->align_offset) &
+ (~info->align_mask);
/*
* Adjust search limits by the desired length.
* See implementation comment at top of unmapped_area().
info->low_limit, length);
pr_err("mas.min %lu max %lu mas.last %lu\n", mas.min, mas.max,
mas.last);
- pr_err("mas.index %lu align %lu offset %lu\n", mas.index,
- info->align_offset, info->align_mask);
+ pr_err("mas.index %lu align mask %lu offset %lu\n", mas.index,
+ info->align_mask, info->align_offset);
pr_err("rb_find_vma find on %lu => %px (%px)\n", mas.index,
rb_find_vma(mm, mas.index), vma);
mt_dump(&mm->mm_mt);