public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Premysl Hruby <dfenze@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: slight simplification in transaction.c
Date: Thu, 10 Sep 2009 23:04:49 +0200	[thread overview]
Message-ID: <20090910210449.GA5329@baldr.the> (raw)

Hi there,

While reading source, I found possible simplification 
in btrfs_record_root_in_trans 

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index cdbb502..7cd7bf9 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -123,12 +123,9 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
                return 0;
 
        mutex_lock(&root->fs_info->trans_mutex);
-       if (root->last_trans == trans->transid) {
-               mutex_unlock(&root->fs_info->trans_mutex);
-               return 0;
-       }
+       if (root->last_trans != trans->transid)
+               record_root_in_trans(trans, root);
 
-       record_root_in_trans(trans, root);
        mutex_unlock(&root->fs_info->trans_mutex);
        return 0;
 }


-- 
Premysl "Anydot" Hruby, http://www.redrum.cz/
-
I'm a signature virus. Please add me to your signature and help me spread!

                 reply	other threads:[~2009-09-10 21:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090910210449.GA5329@baldr.the \
    --to=dfenze@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox