Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130374
b: refs/heads/master
c: de33c8d
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jan 30, 2009
1 parent b84895d commit 1b4ae49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 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: 18e352e4a73465349711a9324767e1b2453383e2
refs/heads/master: de33c8db5910cda599899dd431cc30d7c1018cbf
26 changes: 6 additions & 20 deletions trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,16 +1134,11 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
}

/*
* Can we just expand an old private anonymous mapping?
* The VM_SHARED test is necessary because shmem_zero_setup
* will create the file object for a shared anonymous map below.
* Can we just expand an old mapping?
*/
if (!file && !(vm_flags & VM_SHARED)) {
vma = vma_merge(mm, prev, addr, addr + len, vm_flags,
NULL, NULL, pgoff, NULL);
if (vma)
goto out;
}
vma = vma_merge(mm, prev, addr, addr + len, vm_flags, NULL, file, pgoff, NULL);
if (vma)
goto out;

/*
* Determine the object being mapped and call the appropriate
Expand Down Expand Up @@ -1206,17 +1201,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
if (vma_wants_writenotify(vma))
vma->vm_page_prot = vm_get_page_prot(vm_flags & ~VM_SHARED);

if (file && vma_merge(mm, prev, addr, vma->vm_end,
vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) {
mpol_put(vma_policy(vma));
kmem_cache_free(vm_area_cachep, vma);
fput(file);
if (vm_flags & VM_EXECUTABLE)
removed_exe_file_vma(mm);
} else {
vma_link(mm, vma, prev, rb_link, rb_parent);
file = vma->vm_file;
}
vma_link(mm, vma, prev, rb_link, rb_parent);
file = vma->vm_file;

/* Once vma denies write, undo our temporary denial count */
if (correct_wcount)
Expand Down

0 comments on commit 1b4ae49

Please sign in to comment.