From: Jeff Layton Subject: [PATCH] vfs: remove unneeded hlist_unhashed check from get_active_super Date: Tue, 14 Oct 2014 06:36:55 -0400 Message-ID: <1413283015-2609-1-git-send-email-jlayton@primarydata.com> Cc: linux-fsdevel@vger.kernel.org, trond.myklebust@primarydata.com, tao.peng@primarydata.com To: Al Viro Return-path: Received: from mail-qg0-f53.google.com ([209.85.192.53]:36124 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755104AbaJNKhE (ORCPT ); Tue, 14 Oct 2014 06:37:04 -0400 Received: by mail-qg0-f53.google.com with SMTP id q107so2418416qgd.40 for ; Tue, 14 Oct 2014 03:37:03 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: As best I can tell, a superblock is only ever removed from the fs_supers list after the s_active counter goes to zero. Thus, the hlist_unhashed check here is redundant, since the atomic_inc_not_zero check in grab_super will catch that case anyway. Cc: Trond Myklebust Cc: Peng Tao Signed-off-by: Jeff Layton --- fs/super.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/super.c b/fs/super.c index eae088f6aaae..7ff277547c1e 100644 --- a/fs/super.c +++ b/fs/super.c @@ -320,9 +320,7 @@ EXPORT_SYMBOL(deactivate_super); * and want to turn it into a full-blown active reference. grab_super() * is called with sb_lock held and drops it. Returns 1 in case of * success, 0 if we had failed (superblock contents was already dead or - * dying when grab_super() had been called). Note that this is only - * called for superblocks not in rundown mode (== ones still on ->fs_supers - * of their type), so increment of ->s_count is OK here. + * dying when grab_super() had been called). */ static int grab_super(struct super_block *s) __releases(sb_lock) { @@ -641,8 +639,6 @@ struct super_block *get_active_super(struct block_device *bdev) restart: spin_lock(&sb_lock); list_for_each_entry(sb, &super_blocks, s_list) { - if (hlist_unhashed(&sb->s_instances)) - continue; if (sb->s_bdev == bdev) { if (!grab_super(sb)) goto restart; -- 1.9.3