From patchwork Fri May 11 20:13:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10395319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3EECC601A0 for ; Fri, 11 May 2018 20:14:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 351A428D2D for ; Fri, 11 May 2018 20:14:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A0EB28FAF; Fri, 11 May 2018 20:14:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDA7E28D2D for ; Fri, 11 May 2018 20:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751756AbeEKUOj (ORCPT ); Fri, 11 May 2018 16:14:39 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:35708 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856AbeEKUN5 (ORCPT ); Fri, 11 May 2018 16:13:57 -0400 Received: by mail-pl0-f66.google.com with SMTP id i5-v6so3868856plt.2 for ; Fri, 11 May 2018 13:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=kbtWGXlg54c4EZT65NgXH/MG8hTK7g0lD+MmW1iAN9g=; b=h/VhR+pgvqm18/KfWj2jCQfsTbe+HNgWLDBTrZdIU/Uj/Q1N9PaePr6tog6kMU3ngJ 7MDIGfSZcnMh6t/ZbC54B56unNOGdX3J5E4G5J+qtWs3CLytuQi62YMzmbXDtWfFCTXv mWA4B//zuN8kanStr9gYLWrhm+aj9weRQvKaui7p8Lf71Un7vWWV8b311iK202X0Skag nxFWLVP+KCbILK4L0zlxoAK4dC1dDW5RvKGZL2iBWobOcG3VaOzxDKtVIACnPrVu6VTz DULHrAoVWuRKD20G3B0D6ZjTg2CPuOSR6DyyaQJ03YpDNXmYyc/QREUOWRSTxe24jFvp HJ9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=kbtWGXlg54c4EZT65NgXH/MG8hTK7g0lD+MmW1iAN9g=; b=Puvsrrlj+k7NwSTmlvXpIy7K9PoQXrTAo3pyQg1VxfeBLSYqVVu+GXe6OHfTm0biJ3 BgtXNA72/VZW7CGTG5qcMIdLvPFMjdimW5FZz4rHmy4b1HRZCX58Er24UJOadmXOoTe1 Wf9/B4JNGTN3lGTZ6QJ5FCZSF3XoIr8KdsuQi/MNH0pvrxrRNAc7VRKX2OUPHqCHNauu Y/Rc+PITiMWpNOc3YUf90O/tOnRY6dmVDACQiVI3cb8BAvp5iDB52x68e93SkkWoLZI0 58+ErmWKqke1tOrfv1JNk2kpOXC8T8ZeouNbtkW/KYgW1i2fIJ4G66TzPiFcGRFG/s3z ek/w== X-Gm-Message-State: ALKqPwdCKG6E0cQG4o0EyWdrKXUSXlTAd2PRO6tL2XFWct8yUvmKcSiJ i8nkYuI/MQ7wuoBWSlHTtaPq5yB+uWg= X-Google-Smtp-Source: AB8JxZop5o2SdZXO9rCobL9OY12SKLKOSeBwA4hVBHokuiXcYOQfWh3h2ZKnpkW7AJlCH2wFj8FAfg== X-Received: by 2002:a17:902:9a9:: with SMTP id 38-v6mr6923812pln.114.1526069636543; Fri, 11 May 2018 13:13:56 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::7:51e4]) by smtp.gmail.com with ESMTPSA id x84-v6sm10088457pfi.160.2018.05.11.13.13.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 13:13:55 -0700 (PDT) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: kernel-team@fb.com, Chris Mason , Josef Bacik , Nikolay Borisov , David Sterba Subject: [PATCH v4 06/12] Btrfs: delete dead code in btrfs_orphan_commit_root() Date: Fri, 11 May 2018 13:13:34 -0700 Message-Id: X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval btrfs_orphan_commit_root() tries to delete an orphan item for a subvolume in the tree root, but we don't actually insert that item in the first place. See commit 0a0d4415e338 ("Btrfs: delete dead code in btrfs_orphan_add()"). We can get rid of it. Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval --- fs/btrfs/inode.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 9ef20d28fa9e..84d7dd3a30f9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3302,7 +3302,6 @@ void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, { struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_block_rsv *block_rsv; - int ret; if (atomic_read(&root->orphan_inodes) || root->orphan_cleanup_state != ORPHAN_CLEANUP_DONE) @@ -3323,17 +3322,6 @@ void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, root->orphan_block_rsv = NULL; spin_unlock(&root->orphan_lock); - if (test_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &root->state) && - btrfs_root_refs(&root->root_item) > 0) { - ret = btrfs_del_orphan_item(trans, fs_info->tree_root, - root->root_key.objectid); - if (ret) - btrfs_abort_transaction(trans, ret); - else - clear_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, - &root->state); - } - if (block_rsv) { WARN_ON(block_rsv->size > 0); btrfs_free_block_rsv(fs_info, block_rsv);