Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] Btrfs: don't iterate mod seq list when putting a tree mod seq
Date: Tue, 28 Jan 2020 17:16:37 +0100	[thread overview]
Message-ID: <20200128161637.GV3929@twin.jikos.cz> (raw)
In-Reply-To: <0e0ebc11-e0e1-c283-3e71-881ba78ed3bf@toxicpanda.com>

On Wed, Jan 22, 2020 at 03:32:16PM -0500, Josef Bacik wrote:
> On 1/22/20 7:23 AM, fdmanana@kernel.org wrote:
> > From: Filipe Manana <fdmanana@suse.com>
> > 
> > Each new element added to the mod seq list is always appended to the list,
> > and each one gets a sequence number coming from a counter which gets
> > incremented everytime a new element is added to the list (or a new node
> > is added to the tree mod log rbtree). Therefore the element with the
> > lowest sequence number is always the first element in the list.
> > 
> > So just remove the list iteration at btrfs_put_tree_mod_seq() that
> > computes the minimum sequence number in the list and replace it with
> > a check for the first element's sequence number.
> > 
> > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> 
> This looks like a prime place for list_first_entry_or_null, but I'm not married 
> to it

The if (!list_empty()) looks more readable to me as it's explicit, only implied
by list_first_entry_or_null.

  reply	other threads:[~2020-01-28 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 12:23 [PATCH 2/2] Btrfs: don't iterate mod seq list when putting a tree mod seq fdmanana
2020-01-22 20:32 ` Josef Bacik
2020-01-28 16:16   ` David Sterba [this message]
2020-01-28 10:50 ` Nikolay Borisov
2020-01-28 16:13 ` 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=20200128161637.GV3929@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=fdmanana@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox