diff options
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c index bca0c618fdb3..a88baebf77cf 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/cdev.h> | 22 | #include <linux/cdev.h> |
23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
24 | #include <linux/inotify.h> | 24 | #include <linux/inotify.h> |
25 | #include <linux/fsnotify.h> | ||
25 | #include <linux/mount.h> | 26 | #include <linux/mount.h> |
26 | #include <linux/async.h> | 27 | #include <linux/async.h> |
27 | 28 | ||
@@ -189,6 +190,10 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode) | |||
189 | inode->i_private = NULL; | 190 | inode->i_private = NULL; |
190 | inode->i_mapping = mapping; | 191 | inode->i_mapping = mapping; |
191 | 192 | ||
193 | #ifdef CONFIG_FSNOTIFY | ||
194 | inode->i_fsnotify_mask = 0; | ||
195 | #endif | ||
196 | |||
192 | return inode; | 197 | return inode; |
193 | 198 | ||
194 | out_free_security: | 199 | out_free_security: |
@@ -221,6 +226,7 @@ void destroy_inode(struct inode *inode) | |||
221 | BUG_ON(inode_has_buffers(inode)); | 226 | BUG_ON(inode_has_buffers(inode)); |
222 | ima_inode_free(inode); | 227 | ima_inode_free(inode); |
223 | security_inode_free(inode); | 228 | security_inode_free(inode); |
229 | fsnotify_inode_delete(inode); | ||
224 | if (inode->i_sb->s_op->destroy_inode) | 230 | if (inode->i_sb->s_op->destroy_inode) |
225 | inode->i_sb->s_op->destroy_inode(inode); | 231 | inode->i_sb->s_op->destroy_inode(inode); |
226 | else | 232 | else |
@@ -252,6 +258,9 @@ void inode_init_once(struct inode *inode) | |||
252 | INIT_LIST_HEAD(&inode->inotify_watches); | 258 | INIT_LIST_HEAD(&inode->inotify_watches); |
253 | mutex_init(&inode->inotify_mutex); | 259 | mutex_init(&inode->inotify_mutex); |
254 | #endif | 260 | #endif |
261 | #ifdef CONFIG_FSNOTIFY | ||
262 | INIT_HLIST_HEAD(&inode->i_fsnotify_mark_entries); | ||
263 | #endif | ||
255 | } | 264 | } |
256 | EXPORT_SYMBOL(inode_init_once); | 265 | EXPORT_SYMBOL(inode_init_once); |
257 | 266 | ||
@@ -398,6 +407,7 @@ int invalidate_inodes(struct super_block *sb) | |||
398 | mutex_lock(&iprune_mutex); | 407 | mutex_lock(&iprune_mutex); |
399 | spin_lock(&inode_lock); | 408 | spin_lock(&inode_lock); |
400 | inotify_unmount_inodes(&sb->s_inodes); | 409 | inotify_unmount_inodes(&sb->s_inodes); |
410 | fsnotify_unmount_inodes(&sb->s_inodes); | ||
401 | busy = invalidate_list(&sb->s_inodes, &throw_away); | 411 | busy = invalidate_list(&sb->s_inodes, &throw_away); |
402 | spin_unlock(&inode_lock); | 412 | spin_unlock(&inode_lock); |
403 | 413 | ||
@@ -1412,7 +1422,7 @@ void file_update_time(struct file *file) | |||
1412 | if (IS_NOCMTIME(inode)) | 1422 | if (IS_NOCMTIME(inode)) |
1413 | return; | 1423 | return; |
1414 | 1424 | ||
1415 | err = mnt_want_write(file->f_path.mnt); | 1425 | err = mnt_want_write_file(file); |
1416 | if (err) | 1426 | if (err) |
1417 | return; | 1427 | return; |
1418 | 1428 | ||