Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277027
b: refs/heads/master
c: e26a511
h: refs/heads/master
i:
  277025: 12126e2
  277023: 052297a
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Dec 30, 2011
1 parent 9d0fd56 commit 31b196c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 757e55c23dc62eb5adf45368a72f6b26d6a71ae5
refs/heads/master: e26a51148f3ebd859bca8bf2e0f212839b447f62
11 changes: 10 additions & 1 deletion trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,20 +636,29 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
struct vm_area_struct *prev;
struct vm_area_struct *vma;
int err = 0;
pgoff_t pgoff;
unsigned long vmstart;
unsigned long vmend;

vma = find_vma_prev(mm, start, &prev);
if (!vma || vma->vm_start > start)
return -EFAULT;

if (start > vma->vm_start)
prev = vma;

for (; vma && vma->vm_start < end; prev = vma, vma = next) {
next = vma->vm_next;
vmstart = max(start, vma->vm_start);
vmend = min(end, vma->vm_end);

if (mpol_equal(vma_policy(vma), new_pol))
continue;

pgoff = vma->vm_pgoff +
((vmstart - vma->vm_start) >> PAGE_SHIFT);
prev = vma_merge(mm, prev, vmstart, vmend, vma->vm_flags,
vma->anon_vma, vma->vm_file, vma->vm_pgoff,
vma->anon_vma, vma->vm_file, pgoff,
new_pol);
if (prev) {
vma = prev;
Expand Down

0 comments on commit 31b196c

Please sign in to comment.