All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: jeffm@suse.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/7] btrfs-progs: backref: add list_first_pref helper
Date: Wed, 26 Jul 2017 10:08:40 +0300	[thread overview]
Message-ID: <ac5c6a7c-97e9-2230-934b-8e5cb371dc94@suse.com> (raw)
In-Reply-To: <20170725205138.28376-5-jeffm@suse.com>



On 25.07.2017 23:51, jeffm@suse.com wrote:
> From: Jeff Mahoney <jeffm@suse.com>
> 
> ---
>  backref.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/backref.c b/backref.c
> index ac1b506..be3376a 100644
> --- a/backref.c
> +++ b/backref.c
> @@ -130,6 +130,11 @@ struct __prelim_ref {
>  	u64 wanted_disk_byte;
>  };
>  
> +static struct __prelim_ref *list_first_pref(struct list_head *head)
> +{
> +	return list_first_entry(head, struct __prelim_ref, list);
> +}
> +

I think this just adds one more level of abstraction with no real
benefit whatsoever. Why not drop the patch entirely.

>  struct pref_state {
>  	struct list_head pending;
>  };
> @@ -804,8 +809,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
>  	__merge_refs(&prefstate, 2);
>  
>  	while (!list_empty(&prefstate.pending)) {
> -		ref = list_first_entry(&prefstate.pending,
> -				       struct __prelim_ref, list);
> +		ref = list_first_pref(&prefstate.pending);
>  		WARN_ON(ref->count < 0);
>  		if (roots && ref->count && ref->root_id && ref->parent == 0) {
>  			/* no parent == root of tree */
> @@ -857,8 +861,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
>  out:
>  	btrfs_free_path(path);
>  	while (!list_empty(&prefstate.pending)) {
> -		ref = list_first_entry(&prefstate.pending,
> -				       struct __prelim_ref, list);
> +		ref = list_first_pref(&prefstate.pending);
>  		list_del(&ref->list);
>  		kfree(ref);
>  	}
> 

  reply	other threads:[~2017-07-26  7:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 20:51 [PATCH 1/7] btrfs-progs: check: supplement extent backref list with rbtree jeffm
2017-07-25 20:51 ` [PATCH 2/7] btrfs-progs: check: switch to iterating over the backref_tree jeffm
2017-07-25 20:51 ` [PATCH 3/7] btrfs-progs: extent-cache: actually cache extent buffers jeffm
2017-07-26  7:00   ` Nikolay Borisov
2017-07-26 13:21     ` Jeff Mahoney
2017-08-22 15:44   ` David Sterba
2017-07-25 20:51 ` [PATCH 4/7] btrfs-progs: backref: push state tracking into a helper structure jeffm
2017-07-25 20:51 ` [PATCH 5/7] btrfs-progs: backref: add list_first_pref helper jeffm
2017-07-26  7:08   ` Nikolay Borisov [this message]
2017-07-26 13:22     ` Jeff Mahoney
2017-07-26 13:25       ` Jeff Mahoney
2017-07-25 20:51 ` [PATCH 6/7] btrfs-progs: backref: use separate list for missing keys jeffm
2017-07-25 20:51 ` [PATCH 7/7] btrfs-progs: backref: use separate list for indirect refs jeffm
2017-09-29 17:21 ` [PATCH 1/7] btrfs-progs: check: supplement extent backref list with rbtree 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=ac5c6a7c-97e9-2230-934b-8e5cb371dc94@suse.com \
    --to=nborisov@suse.com \
    --cc=jeffm@suse.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.