Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93977
b: refs/heads/master
c: 4d3d5b4
h: refs/heads/master
i:
  93975: 883c92e
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 28, 2008
1 parent 8aa1eef commit 111b9af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 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: 0dd1334faf7e075bfdb6f5284eed65210b296fc1
refs/heads/master: 4d3d5b41a72b52555d43efbfc4ccde6ba6e5444f
23 changes: 10 additions & 13 deletions trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
mapping_cap_account_dirty(vma->vm_file->f_mapping);
}


unsigned long mmap_region(struct file *file, unsigned long addr,
unsigned long len, unsigned long flags,
unsigned int vm_flags, unsigned long pgoff,
Expand Down Expand Up @@ -1181,22 +1180,20 @@ 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,
if (file && vma_merge(mm, prev, addr, vma->vm_end,
vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) {
file = vma->vm_file;
vma_link(mm, vma, prev, rb_link, rb_parent);
if (correct_wcount)
atomic_inc(&inode->i_writecount);
} else {
if (file) {
if (correct_wcount)
atomic_inc(&inode->i_writecount);
fput(file);
}
mpol_free(vma_policy(vma));
kmem_cache_free(vm_area_cachep, vma);
fput(file);
} else {
vma_link(mm, vma, prev, rb_link, rb_parent);
file = vma->vm_file;
}
out:

/* Once vma denies write, undo our temporary denial count */
if (correct_wcount)
atomic_inc(&inode->i_writecount);
out:
mm->total_vm += len >> PAGE_SHIFT;
vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
if (vm_flags & VM_LOCKED) {
Expand Down

0 comments on commit 111b9af

Please sign in to comment.