diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-18 14:54:00 +0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-18 16:46:10 +0400 |
commit | d3a9262e59f7fb83c6d44df3b2b1460ed57d3ea1 (patch) | |
tree | 563952174f1ffec3d6d27fc3c38d4dc009b6787d /fs/anon_inodes.c | |
parent | e24a72c4d8f0b2c17783b3ba9c8931b537149423 (diff) | |
download | linux-d3a9262e59f7fb83c6d44df3b2b1460ed57d3ea1.tar.xz |
fs: Provide empty .set_page_dirty() aop for anon inodes
.set_page_dirty() is one of those a_ops that defaults to the
buffer implementation when not set. Therefore provide a dummy
function to make it do nothing.
(Uncovered by perfcounters fd's which can now be writable-mmap-ed.)
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/anon_inodes.c')
-rw-r--r-- | fs/anon_inodes.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c index 1dd96d4406c0..47d4a01c5393 100644 --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -52,6 +52,19 @@ static const struct dentry_operations anon_inodefs_dentry_operations = { .d_delete = anon_inodefs_delete_dentry, }; +/* + * nop .set_page_dirty method so that people can use .page_mkwrite on + * anon inodes. + */ +static int anon_set_page_dirty(struct page *page) +{ + return 0; +}; + +static const struct address_space_operations anon_aops = { + .set_page_dirty = anon_set_page_dirty, +}; + /** * anon_inode_getfd - creates a new file instance by hooking it up to an * anonymous inode, and a dentry that describe the "class" @@ -151,6 +164,8 @@ static struct inode *anon_inode_mkinode(void) inode->i_fop = &anon_inode_fops; + inode->i_mapping->a_ops = &anon_aops; + /* * Mark the inode dirty from the very beginning, * that way it will never be moved to the dirty |