summaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-02-01 09:21:58 +0100
committerJan Kara <jack@suse.cz>2017-04-10 17:37:35 +0200
commit08991e83b7286635167bab40927665a90fb00d81 (patch)
treee82e62c0a92193ff3af83d3d1ea60f0430c5c118 /fs/inode.c
parent04662cab59fc3e8421fd7a0539d304d51d2750a4 (diff)
downloadlinux-stable-08991e83b7286635167bab40927665a90fb00d81.tar.gz
linux-stable-08991e83b7286635167bab40927665a90fb00d81.tar.bz2
linux-stable-08991e83b7286635167bab40927665a90fb00d81.zip
fsnotify: Free fsnotify_mark_connector when there is no mark attached
Currently we free fsnotify_mark_connector structure only when inode / vfsmount is getting freed. This can however impose noticeable memory overhead when marks get attached to inodes only temporarily. So free the connector structure once the last mark is detached from the object. Since notification infrastructure can be working with the connector under the protection of fsnotify_mark_srcu, we have to be careful and free the fsnotify_mark_connector only after SRCU period passes. Reviewed-by: Miklos Szeredi <mszeredi@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 750e952d2918..131b2bcebc48 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -234,9 +234,6 @@ void __destroy_inode(struct inode *inode)
inode_detach_wb(inode);
security_inode_free(inode);
fsnotify_inode_delete(inode);
-#ifdef CONFIG_FSNOTIFY
- fsnotify_connector_free(&inode->i_fsnotify_marks);
-#endif
locks_free_lock_context(inode);
if (!inode->i_nlink) {
WARN_ON(atomic_long_read(&inode->i_sb->s_remove_count) == 0);