Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61536
b: refs/heads/master
c: 3ee6daf
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jul 19, 2007
1 parent 8fe5d1e commit bc8cd81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb2d5ce16409efcdf94017a6b6fecd468226e29c
refs/heads/master: 3ee6dafc677a68e461a7ddafc94a580ebab80735
19 changes: 19 additions & 0 deletions trunk/mm/fremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,25 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
goto retry;
}
mapping = vma->vm_file->f_mapping;
/*
* page_mkclean doesn't work on nonlinear vmas, so if
* dirty pages need to be accounted, emulate with linear
* vmas.
*/
if (mapping_cap_account_dirty(mapping)) {
unsigned long addr;

flags &= MAP_NONBLOCK;
addr = mmap_region(vma->vm_file, start, size,
flags, vma->vm_flags, pgoff, 1);
if (IS_ERR_VALUE(addr)) {
err = addr;
} else {
BUG_ON(addr != start);
err = 0;
}
goto out;
}
spin_lock(&mapping->i_mmap_lock);
flush_dcache_mmap_lock(mapping);
vma->vm_flags |= VM_NONLINEAR;
Expand Down

0 comments on commit bc8cd81

Please sign in to comment.