diff options
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 = { | |||
52 | .d_delete = anon_inodefs_delete_dentry, | 52 | .d_delete = anon_inodefs_delete_dentry, |
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* | ||
56 | * nop .set_page_dirty method so that people can use .page_mkwrite on | ||
57 | * anon inodes. | ||
58 | */ | ||
59 | static int anon_set_page_dirty(struct page *page) | ||
60 | { | ||
61 | return 0; | ||
62 | }; | ||
63 | |||
64 | static const struct address_space_operations anon_aops = { | ||
65 | .set_page_dirty = anon_set_page_dirty, | ||
66 | }; | ||
67 | |||
55 | /** | 68 | /** |
56 | * anon_inode_getfd - creates a new file instance by hooking it up to an | 69 | * anon_inode_getfd - creates a new file instance by hooking it up to an |
57 | * anonymous inode, and a dentry that describe the "class" | 70 | * anonymous inode, and a dentry that describe the "class" |
@@ -151,6 +164,8 @@ static struct inode *anon_inode_mkinode(void) | |||
151 | 164 | ||
152 | inode->i_fop = &anon_inode_fops; | 165 | inode->i_fop = &anon_inode_fops; |
153 | 166 | ||
167 | inode->i_mapping->a_ops = &anon_aops; | ||
168 | |||
154 | /* | 169 | /* |
155 | * Mark the inode dirty from the very beginning, | 170 | * Mark the inode dirty from the very beginning, |
156 | * that way it will never be moved to the dirty | 171 | * that way it will never be moved to the dirty |