Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288291
b: refs/heads/master
c: 097d591
h: refs/heads/master
i:
  288289: eccbca6
  288287: 5d4ae2c
v: v3
  • Loading branch information
Linus Torvalds committed Mar 7, 2012
1 parent 14e08ae commit 6eaf41d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 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: 71fece9511717750d86691e0f517ad04f3c8a801
refs/heads/master: 097d59106a8e4b42d07c9892fdd7790f1659c6ff
4 changes: 3 additions & 1 deletion trunk/arch/x86/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,15 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file,
* Lookup failure means no vma is above this address,
* i.e. return with success:
*/
if (!(vma = find_vma_prev(mm, addr, &prev_vma)))
vma = find_vma(mm, add);
if (!vma)
return addr;

/*
* new region fits between prev_vma->vm_end and
* vma->vm_start, use it:
*/
prev_vma = vma->vm_prev;
if (addr + len <= vma->vm_start &&
(!prev_vma || (addr >= prev_vma->vm_end))) {
/* remember the address as a hint for next time */
Expand Down
3 changes: 2 additions & 1 deletion trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,11 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
unsigned long vmstart;
unsigned long vmend;

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

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

Expand Down
3 changes: 2 additions & 1 deletion trunk/mm/mlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,11 @@ static int do_mlock(unsigned long start, size_t len, int on)
return -EINVAL;
if (end == start)
return 0;
vma = find_vma_prev(current->mm, start, &prev);
vma = find_vma(current->mm, start);
if (!vma || vma->vm_start > start)
return -ENOMEM;

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

Expand Down
3 changes: 2 additions & 1 deletion trunk/mm/mprotect.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,

down_write(&current->mm->mmap_sem);

vma = find_vma_prev(current->mm, start, &prev);
vma = find_vma(current->mm, start);
error = -ENOMEM;
if (!vma)
goto out;
prev = vma->vm_prev;
if (unlikely(grows & PROT_GROWSDOWN)) {
if (vma->vm_start >= end)
goto out;
Expand Down

0 comments on commit 6eaf41d

Please sign in to comment.