From: David Howells The attached patch makes the page-becoming-writable notification a VMA operation only - it removes the equivalent address-space operation and the chaining of the call. Signed-Off-By: David Howells Signed-off-by: Andrew Morton --- include/linux/fs.h | 3 --- mm/filemap.c | 19 +------------------ 2 files changed, 1 insertion(+), 21 deletions(-) diff -puN include/linux/fs.h~make-page-becoming-writable-notification-a-vma-op-only include/linux/fs.h --- 25/include/linux/fs.h~make-page-becoming-writable-notification-a-vma-op-only 2005-05-05 14:42:13.000000000 -0700 +++ 25-akpm/include/linux/fs.h 2005-05-05 14:42:13.000000000 -0700 @@ -331,9 +331,6 @@ struct address_space_operations { int (*releasepage) (struct page *, int); ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, loff_t offset, unsigned long nr_segs); - - /* notification that a page is about to become writable */ - int (*page_mkwrite)(struct page *page); }; struct backing_dev_info; diff -puN mm/filemap.c~make-page-becoming-writable-notification-a-vma-op-only mm/filemap.c --- 25/mm/filemap.c~make-page-becoming-writable-notification-a-vma-op-only 2005-05-05 14:42:13.000000000 -0700 +++ 25-akpm/mm/filemap.c 2005-05-05 14:42:13.000000000 -0700 @@ -1527,25 +1527,11 @@ repeat: return 0; } -/* - * pass notification that a page is becoming writable up to the filesystem - */ -static int filemap_page_mkwrite(struct vm_area_struct *vma, struct page *page) -{ - return page->mapping->a_ops->page_mkwrite(page); -} - struct vm_operations_struct generic_file_vm_ops = { .nopage = filemap_nopage, .populate = filemap_populate, }; -struct vm_operations_struct generic_file_vm_mkwr_ops = { - .nopage = filemap_nopage, - .populate = filemap_populate, - .page_mkwrite = filemap_page_mkwrite, -}; - /* This is used for a general mmap of a disk file */ int generic_file_mmap(struct file * file, struct vm_area_struct * vma) @@ -1555,10 +1541,7 @@ int generic_file_mmap(struct file * file if (!mapping->a_ops->readpage) return -ENOEXEC; file_accessed(file); - if (!mapping->a_ops->page_mkwrite) - vma->vm_ops = &generic_file_vm_ops; - else - vma->vm_ops = &generic_file_vm_mkwr_ops; + vma->vm_ops = &generic_file_vm_ops; return 0; } EXPORT_SYMBOL(filemap_populate); _