All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hao Peng <flyingpenghao@gmail.com>
To: "clm@fb.com" <clm@fb.com>,
	"josef@toxicpanda.com" <josef@toxicpanda.com>,
	"dsterba@suse.com" <dsterba@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: [PATCH] btrfs: remove redundant code
Date: Fri, 23 Sep 2022 22:56:12 +0800	[thread overview]
Message-ID: <CAPm50a+6tGRCkB7=QiA+y5EEPm_40N6d-KChPxnT+40Q=5EUQw@mail.gmail.com> (raw)

From: Peng Hao <flyingpeng@tencent.com>

Since leaf is already NULL, and no other branch will go fail_unlock,
the fail_unlock branch is useless.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
 fs/btrfs/disk-io.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 4c3166f3c725..f39165aec175 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1284,7 +1284,7 @@ struct btrfs_root *btrfs_create_tree(struct
btrfs_trans_handle *trans,
        if (IS_ERR(leaf)) {
                ret = PTR_ERR(leaf);
                leaf = NULL;
-               goto fail_unlock;
+               goto fail;
        }

        root->node = leaf;
@@ -1319,9 +1319,6 @@ struct btrfs_root *btrfs_create_tree(struct
btrfs_trans_handle *trans,

        return root;

-fail_unlock:
-       if (leaf)
-               btrfs_tree_unlock(leaf);
 fail:
        btrfs_put_root(root);

--
2.27.0

             reply	other threads:[~2022-09-23 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 14:56 Hao Peng [this message]
2022-10-07 16:32 ` [PATCH] btrfs: remove redundant code David Sterba
  -- strict thread matches above, loose matches on Subject: below --
2022-09-18  7:26 flyingpeng(彭浩)
2017-07-12  6:32 [PATCH] btrfs: Remove " Nikolay Borisov
2017-07-12 14:55 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPm50a+6tGRCkB7=QiA+y5EEPm_40N6d-KChPxnT+40Q=5EUQw@mail.gmail.com' \
    --to=flyingpenghao@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.