Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1645663ioo; Sun, 22 May 2022 22:50:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc/IK5pQRbNMAWAKjbh23sRBxETb2FZ2Hj3nJnFi/pyowLqRR1G/yO+XyOs+k20ILASOlN X-Received: by 2002:aa7:90cd:0:b0:518:2a84:7d86 with SMTP id k13-20020aa790cd000000b005182a847d86mr21882036pfk.8.1653285055061; Sun, 22 May 2022 22:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653285055; cv=none; d=google.com; s=arc-20160816; b=Rs2iPvFWflJAbjubhdbCMOBa8jqE5aI3RmI/wZibvXd7y6mlpc3MGjbKxsAnriGKac E6M8iNHthnd9hDZD6FCB0rjDyXuo+9CM+Rw34ZdpWB9DTwjTsDKVVnew4VpGDvDjM/Kj I7UEZvZkVSTeM2rXBUBO5PSiPZfmU7PxVgLK5DvqShnYSfxmlr6YtygWxD7LGGlgfgvX bfsd57PWx+tkbCb4TDxJ/yUIr1gwXVXweoNXJC+bYo/Hj+BkF4Lg/WdqjyazF65c7YuC ZYV6foTNT4FjK/YdoP4o0G2igJfAYEW2yD5iS/vVlvacJU/5HuyvBJfS0rHXZkb3OpsB xYqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hIXlAdXaXHyH6DtQK9VpbuUE3h2kXrb+BZRWp2D1Xdw=; b=lG3omwDFODgVg/AjPrxvBTwJtMb1jQIFGFnCvMwklzzkdIpd1ynITyEry+5XiahFRR d4zsIJlSknpPSNC7KTC9UsK6rK2z6aAy9xdUQdRnmn8c1kdaOc1bJQVp8bdhDm7Jgot3 RV/JdfSdiBo/zPqmkpVac7m0LRTWXwLRmcgEt7EFwtSvFxCCebZtSWzjoxYICkEC1+V1 hXwPBlu2rvZ+EWtfcg/CYlra0WCe7TKjspxfstJXWXu/lrvC+SEPD+7wCEz/79k7ZCJC kk5vOpYdjtTOevctIbd58lI6IrWccgjUSSHnGvxa0xHrX/GOzk6lCoh3NJPkVh1ndla0 ODQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="tjn1x/Xw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c188-20020a624ec5000000b0050e096589cbsi11516258pfb.368.2022.05.22.22.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 22:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="tjn1x/Xw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CDB7426AC3; Sun, 22 May 2022 22:49:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231965AbiETPpX (ORCPT + 99 others); Fri, 20 May 2022 11:45:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351027AbiETPpT (ORCPT ); Fri, 20 May 2022 11:45:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A3F21796FA; Fri, 20 May 2022 08:45:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 739BCB82A5D; Fri, 20 May 2022 15:45:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38ECBC385A9; Fri, 20 May 2022 15:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653061513; bh=Vc86LN9Kl/kZdHiyBqJ9vnK7hHKZmKIn6mH8vCk639M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tjn1x/XwdFtK55Z368/s6bzfN+nq7NRkd3rJvNKtBtxLNYNbKE5tSt9x+Y4dOJJIZ FGY8qJTLiBVfhYgQmHSPErYznIt3/8QR12w1GRrO5NCkxoygKksR+epBR8vy4QEiJ1 OcdAeC6jaoV90v8zjOBXfswvgpeM9yJXVRQrkg15HYFMikXffAymyH2CjD5mHeVqQh g1bK9+9seL8tsriVPWJk6W4D9BtkaviorXZ9ADOxU7z5b7J3wf/mb2jXc3LAdbi8fh S9rwkVk/NbS6ds0XK9+PUCrQxxl3L5iId4GqzlpGu4ddohJjdLYUNDwJILbmxAoHRl I+9qZB248p1cw== Date: Fri, 20 May 2022 08:45:12 -0700 From: "Darrick J. Wong" To: Jiapeng Chong Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Abaci Robot Subject: Re: [PATCH v2] xfs: Remove dead code Message-ID: References: <20220520064416.5092-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520064416.5092-1-jiapeng.chong@linux.alibaba.com> X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 20, 2022 at 02:44:16PM +0800, Jiapeng Chong wrote: > Remove tht entire xlog_recover_check_summary() function, this entire > function is dead code and has been for 12 years. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong LGTM, Reviewed-by: Darrick J. Wong --D > --- > Changes in v2: > -Remove dead code. > > fs/xfs/xfs_log_recover.c | 59 ---------------------------------------- > 1 file changed, 59 deletions(-) > > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 97b941c07957..b1980d7cbbee 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -39,13 +39,6 @@ STATIC int > xlog_clear_stale_blocks( > struct xlog *, > xfs_lsn_t); > -#if defined(DEBUG) > -STATIC void > -xlog_recover_check_summary( > - struct xlog *); > -#else > -#define xlog_recover_check_summary(log) > -#endif > STATIC int > xlog_do_recovery_pass( > struct xlog *, xfs_daddr_t, xfs_daddr_t, int, xfs_daddr_t *); > @@ -3339,8 +3332,6 @@ xlog_do_recover( > } > mp->m_alloc_set_aside = xfs_alloc_set_aside(mp); > > - xlog_recover_check_summary(log); > - > /* Normal transactions can now occur */ > clear_bit(XLOG_ACTIVE_RECOVERY, &log->l_opstate); > return 0; > @@ -3483,7 +3474,6 @@ xlog_recover_finish( > } > > xlog_recover_process_iunlinks(log); > - xlog_recover_check_summary(log); > > /* > * Recover any CoW staging blocks that are still referenced by the > @@ -3517,52 +3507,3 @@ xlog_recover_cancel( > xlog_recover_cancel_intents(log); > } > > -#if defined(DEBUG) > -/* > - * Read all of the agf and agi counters and check that they > - * are consistent with the superblock counters. > - */ > -STATIC void > -xlog_recover_check_summary( > - struct xlog *log) > -{ > - struct xfs_mount *mp = log->l_mp; > - struct xfs_perag *pag; > - struct xfs_buf *agfbp; > - struct xfs_buf *agibp; > - xfs_agnumber_t agno; > - uint64_t freeblks; > - uint64_t itotal; > - uint64_t ifree; > - int error; > - > - freeblks = 0LL; > - itotal = 0LL; > - ifree = 0LL; > - for_each_perag(mp, agno, pag) { > - error = xfs_read_agf(mp, NULL, pag->pag_agno, 0, &agfbp); > - if (error) { > - xfs_alert(mp, "%s agf read failed agno %d error %d", > - __func__, pag->pag_agno, error); > - } else { > - struct xfs_agf *agfp = agfbp->b_addr; > - > - freeblks += be32_to_cpu(agfp->agf_freeblks) + > - be32_to_cpu(agfp->agf_flcount); > - xfs_buf_relse(agfbp); > - } > - > - error = xfs_read_agi(mp, NULL, pag->pag_agno, &agibp); > - if (error) { > - xfs_alert(mp, "%s agi read failed agno %d error %d", > - __func__, pag->pag_agno, error); > - } else { > - struct xfs_agi *agi = agibp->b_addr; > - > - itotal += be32_to_cpu(agi->agi_count); > - ifree += be32_to_cpu(agi->agi_freecount); > - xfs_buf_relse(agibp); > - } > - } > -} > -#endif /* DEBUG */ > -- > 2.20.1.7.g153144c >