summaryrefslogtreecommitdiffstats
path: root/fs/namespace.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/namespace.c
parentfsnotify: Lock object list with connector lock (diff)
downloadlinux-08991e83b7286635167bab40927665a90fb00d81.tar.xz
linux-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/namespace.c')
-rw-r--r--fs/namespace.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 2625e1d97a3a..b3b115bd4e1e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1108,9 +1108,6 @@ static void cleanup_mnt(struct mount *mnt)
if (unlikely(mnt->mnt_pins.first))
mnt_pin_kill(mnt);
fsnotify_vfsmount_delete(&mnt->mnt);
-#ifdef CONFIG_FSNOTIFY
- fsnotify_connector_free(&mnt->mnt_fsnotify_marks);
-#endif
dput(mnt->mnt.mnt_root);
deactivate_super(mnt->mnt.mnt_sb);
mnt_free_id(mnt);