From patchwork Mon Oct 19 11:37:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 7435181 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A3D57BEEA4 for ; Mon, 19 Oct 2015 11:42:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAD0820696 for ; Mon, 19 Oct 2015 11:42:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E45F420691 for ; Mon, 19 Oct 2015 11:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752224AbbJSLma (ORCPT ); Mon, 19 Oct 2015 07:42:30 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35055 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbbJSLm3 (ORCPT ); Mon, 19 Oct 2015 07:42:29 -0400 Received: by pasz6 with SMTP id z6so28640929pas.2 for ; Mon, 19 Oct 2015 04:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X78I8uwj127M9QoLqG683J57Z2RIZUjpB6loNboFE9Y=; b=kebcemLs9QnGV0GVsDLQGBpPPhGac9lp0yIC1tj79JTOaRF4qQdgMFiF6EcekIlM5A 3lna2cocR8JyXnEECmzgVHo2f+lmJQd9gW12VX7/mAWp2BlnJl1Uqm13rxdh5kXVJvtW 9ngbKwKaZct1hcQuCfnTmPJjIMRqnUkY79VIJbUGyK6ahloSntWRqCFcna1AyRw3Be+X X+Rsg6Mc5c76wmTYCD3GnCHOI6U5AMJlxEi/5MU+lcG5ws2obIA+tl+WpngNrDnvWU5i YTnrS90M26dzBiGisqxWmJ5qNUtO8kqcD7l9EgxFXf8Hx33LZ9SOabZaJnydl5b3xhhZ Tw3Q== X-Received: by 10.66.234.138 with SMTP id ue10mr34648766pac.9.1445254949563; Mon, 19 Oct 2015 04:42:29 -0700 (PDT) Received: from localhost ([128.199.137.77]) by smtp.gmail.com with ESMTPSA id we9sm36258288pab.3.2015.10.19.04.42.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2015 04:42:29 -0700 (PDT) From: Eryu Guan To: linux-btrfs@vger.kernel.org Cc: Eryu Guan Subject: [PATCH 03/10] btrfs-progs: remove deadcode around metadump_v2 in check_chunk_refs Date: Mon, 19 Oct 2015 19:37:53 +0800 Message-Id: <1445254680-11102-4-git-send-email-guaneryu@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1445254680-11102-1-git-send-email-guaneryu@gmail.com> References: <1445254680-11102-1-git-send-email-guaneryu@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP metadump_v2 is initialized to 0 and never updated again. So remove the deadcode. Signed-off-by: Eryu Guan --- I'm not sure about this one, seems metadump_v2 should be initialized depending on whether superblock has BTRFS_SUPER_FLAG_METADUMP_V2 flag set. cmds-check.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index 80a7c29..118a274 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -7597,7 +7597,6 @@ static int check_chunk_refs(struct chunk_record *chunk_rec, u64 devid; u64 offset; u64 length; - int metadump_v2 = 0; int i; int ret = 0; @@ -7610,8 +7609,7 @@ static int check_chunk_refs(struct chunk_record *chunk_rec, cache); if (chunk_rec->length != block_group_rec->offset || chunk_rec->offset != block_group_rec->objectid || - (!metadump_v2 && - chunk_rec->type_flags != block_group_rec->flags)) { + chunk_rec->type_flags != block_group_rec->flags) { if (!silent) fprintf(stderr, "Chunk[%llu, %u, %llu]: length(%llu), offset(%llu), type(%llu) mismatch with block group[%llu, %u, %llu]: offset(%llu), objectid(%llu), flags(%llu)\n", @@ -7645,9 +7643,6 @@ static int check_chunk_refs(struct chunk_record *chunk_rec, ret = 1; } - if (metadump_v2) - return ret; - length = calc_stripe_length(chunk_rec->type_flags, chunk_rec->length, chunk_rec->num_stripes); for (i = 0; i < chunk_rec->num_stripes; ++i) {