linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Mark Fasheh <mfasheh@suse.com>
Cc: linux-btrfs@vger.kernel.org, Mark Fasheh <mfasheh@suse.de>
Subject: Re: [PATCH 2/3] btrfs: move ref finding machinery out of build_backref_tree()
Date: Wed, 11 Sep 2019 12:09:29 -0400	[thread overview]
Message-ID: <20190911160928.47qzqcj332k7bgw2@MacBook-Pro-91.local> (raw)
In-Reply-To: <20190906171533.618-3-mfasheh@suse.com>

On Fri, Sep 06, 2019 at 10:15:32AM -0700, Mark Fasheh wrote:
> From: Mark Fasheh <mfasheh@suse.de>
> 
> build_backref_tree() is walking extent refs in what is an otherwise self
> contained chunk of code.  We can shrink the total number of lines in
> build_backref_tree() *and* make it more readable by moving that walk into
> its own subroutine.
> 
> Signed-off-by: Mark Fasheh <mfasheh@suse.de>
> ---
>  fs/btrfs/backref-cache.c | 110 +++++++++++++++++++++++----------------
>  1 file changed, 65 insertions(+), 45 deletions(-)
> 
> diff --git a/fs/btrfs/backref-cache.c b/fs/btrfs/backref-cache.c
> index d0f6530f23b8..ff0d49ca6e26 100644
> --- a/fs/btrfs/backref-cache.c
> +++ b/fs/btrfs/backref-cache.c
> @@ -336,6 +336,61 @@ int find_inline_backref(struct extent_buffer *leaf, int slot,
>  	return 0;
>  }
>  
> +#define SEARCH_COMPLETE	1
> +#define SEARCH_NEXT	2
> +static int find_next_ref(struct btrfs_root *extent_root, u64 cur_bytenr,
> +			 struct btrfs_path *path, unsigned long *ptr,
> +			 unsigned long *end, struct btrfs_key *key, bool exist)

I'd rather we do an enum here, so it's clear what we're expecting in the code
context.  Thanks,

Josef

  reply	other threads:[~2019-09-11 16:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 17:15 [PATCH 0/3] Relocation/backref cache cleanups Mark Fasheh
2019-09-06 17:15 ` [PATCH 1/3] btrfs: Move backref cache code out of relocation.c Mark Fasheh
2019-09-11 16:08   ` Josef Bacik
2019-09-27 14:43   ` David Sterba
2019-09-06 17:15 ` [PATCH 2/3] btrfs: move ref finding machinery out of build_backref_tree() Mark Fasheh
2019-09-11 16:09   ` Josef Bacik [this message]
2019-09-24 14:49     ` David Sterba
2019-09-26 11:07       ` Josef Bacik
2019-09-06 17:15 ` [PATCH 3/3] btrfs: move useless node processing out of build_backref_cache Mark Fasheh
2019-09-11 16:11   ` Josef Bacik
2019-10-02 12:58 ` [PATCH 0/3] Relocation/backref cache cleanups David Sterba
2019-10-07 15:18   ` 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=20190911160928.47qzqcj332k7bgw2@MacBook-Pro-91.local \
    --to=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=mfasheh@suse.de \
    /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).