Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320977
b: refs/heads/master
c: 4fcf1c6
h: refs/heads/master
i:
  320975: 6c5db1e
v: v3
  • Loading branch information
Jan Kara authored and Al Viro committed Jul 30, 2012
1 parent d30b11e commit 103ec96
Show file tree
Hide file tree
Showing 4 changed files with 22 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: 41c4d25f78c01ede13efee1f2e979f3f35dd26f6
refs/heads/master: 4fcf1c6205fcfc7a226a144ae4d83b7f5415cab8
1 change: 1 addition & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ extern void truncate_inode_pages_range(struct address_space *,

/* generic vm_area_ops exported for stackable file systems */
extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);

/* mm/page-writeback.c */
int write_one_page(struct page *page, int wait);
Expand Down
19 changes: 19 additions & 0 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1712,8 +1712,27 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
}
EXPORT_SYMBOL(filemap_fault);

int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct page *page = vmf->page;
struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
int ret = VM_FAULT_LOCKED;

file_update_time(vma->vm_file);
lock_page(page);
if (page->mapping != inode->i_mapping) {
unlock_page(page);
ret = VM_FAULT_NOPAGE;
goto out;
}
out:
return ret;
}
EXPORT_SYMBOL(filemap_page_mkwrite);

const struct vm_operations_struct generic_file_vm_ops = {
.fault = filemap_fault,
.page_mkwrite = filemap_page_mkwrite,
};

/* This is used for a general mmap of a disk file */
Expand Down
1 change: 1 addition & 0 deletions trunk/mm/filemap_xip.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ static int xip_file_fault(struct vm_area_struct *vma, struct vm_fault *vmf)

static const struct vm_operations_struct xip_file_vm_ops = {
.fault = xip_file_fault,
.page_mkwrite = filemap_page_mkwrite,
};

int xip_file_mmap(struct file * file, struct vm_area_struct * vma)
Expand Down

0 comments on commit 103ec96

Please sign in to comment.