linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 3/3] btrfs: relocation: Use btrfs_backref_iterator infrastructure
Date: Mon, 17 Feb 2020 13:32:01 +0200	[thread overview]
Message-ID: <ef599c24-fa99-8895-9d2c-a385ce341f5e@suse.com> (raw)
In-Reply-To: <20200217063111.65941-4-wqu@suse.com>



On 17.02.20 г. 8:31 ч., Qu Wenruo wrote:
> In the core function of relocation, build_backref_tree, it needs to
> iterate all backref items of one tree block.
> 
> We don't really want to spend our code and reviewers' time to going
> through tons of supportive code just for the backref walk.
> 
> Use btrfs_backref_iterator infrastructure to do the loop.
> 
> The backref items look would be much more easier to read:
> 
> 	ret = btrfs_backref_iterator_start(iterator, cur->bytenr);
> 	for (; ret == 0; ret = btrfs_backref_iterator_next(iterator)) {
> 		/* The really important work */
> 	}
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Just some general observations:

1. You can name the iterator variable as iter, there is no loss of
meaning and less to type
2. The same applies to naming the function - you can shorten their name
by simply contracting iterator to iter.


  reply	other threads:[~2020-02-17 11:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17  6:31 [PATCH v3 0/3] Btrfs: relocation: Refactor build_backref_tree() using btrfs_backref_iterator infrastructure Qu Wenruo
2020-02-17  6:31 ` [PATCH v3 1/3] btrfs: backref: Introduce the skeleton of btrfs_backref_iterator Qu Wenruo
2020-02-17 10:18   ` Nikolay Borisov
2020-02-17  6:31 ` [PATCH v3 2/3] btrfs: backref: Implement btrfs_backref_iterator_next() Qu Wenruo
2020-02-17 10:47   ` Nikolay Borisov
2020-02-17 11:29     ` Qu Wenruo
2020-02-17 11:42       ` Nikolay Borisov
2020-02-17 11:45         ` Qu Wenruo
2020-02-17 14:13           ` Nikolay Borisov
2020-02-17 23:59             ` Qu Wenruo
2020-02-17  6:31 ` [PATCH v3 3/3] btrfs: relocation: Use btrfs_backref_iterator infrastructure Qu Wenruo
2020-02-17 11:32   ` Nikolay Borisov [this message]
2020-02-17 16:01   ` Nikolay Borisov

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=ef599c24-fa99-8895-9d2c-a385ce341f5e@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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;
as well as URLs for NNTP newsgroup(s).