]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fsnotify: Remove useless list deletion and comment
authorJan Kara <jack@suse.cz>
Wed, 15 Mar 2017 09:08:28 +0000 (10:08 +0100)
committerJan Kara <jack@suse.cz>
Mon, 10 Apr 2017 15:37:35 +0000 (17:37 +0200)
After removing all the indirection it is clear that

hlist_del_init_rcu(&mark->obj_list);

in fsnotify_destroy_marks() is not needed as the mark gets removed from
the list shortly afterwards in fsnotify_destroy_mark() ->
fsnotify_detach_mark() -> fsnotify_detach_from_object(). Also there is
no problem with mark being visible on object list while we call
fsnotify_destroy_mark() as parallel destruction of marks from several
places is properly handled (as mentioned in the comment in
fsnotify_destroy_marks(). So just remove the list removal and also the
stale comment.

Reviewed-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/mark.c

index 416ba91750a9f68707d720a649b147ccbd7244cd..b5b641a2b55779a5de22443ea285ad890e0c6e7c 100644 (file)
@@ -620,12 +620,6 @@ void fsnotify_destroy_marks(struct fsnotify_mark_connector *conn)
                }
                mark = hlist_entry(conn->list.first, struct fsnotify_mark,
                                   obj_list);
-               /*
-                * We don't update i_fsnotify_mask / mnt_fsnotify_mask here
-                * since inode / mount is going away anyway. So just remove
-                * mark from the list.
-                */
-               hlist_del_init_rcu(&mark->obj_list);
                fsnotify_get_mark(mark);
                spin_unlock(lock);
                fsnotify_destroy_mark(mark, mark->group);