From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:51151 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753596AbdDCPeh (ORCPT ); Mon, 3 Apr 2017 11:34:37 -0400 From: Jan Kara To: Cc: Miklos Szeredi , Amir Goldstein , Paul Moore , Jan Kara Subject: [PATCH 17/35] fsnotify: Remove useless list deletion and comment Date: Mon, 3 Apr 2017 17:34:06 +0200 Message-Id: <20170403153424.24945-18-jack@suse.cz> In-Reply-To: <20170403153424.24945-1-jack@suse.cz> References: <20170403153424.24945-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/notify/mark.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 416ba91750a9..b5b641a2b557 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -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); -- 2.10.2