All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Suveer Jain <asj@kernel.org>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/6] btrfs: defrag: use simple list_del() in defrag_collect_targets()
Date: Fri, 26 Jun 2026 07:10:58 +0800	[thread overview]
Message-ID: <8334c67f-c8e2-4800-8f25-b2444c2dcdb7@kernel.org> (raw)
In-Reply-To: <ef417c92283d2b96cdc44c7bba0ac2d47c4f324b.1782321584.git.fdmanana@suse.com>

On 26/6/26 03:20, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> When freeing the entries from the list there is no need to initialize
> the list member in an entry, since we are immediately freeing it. So use
> simple list_del() instead of list_del_init().
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>  fs/btrfs/defrag.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/defrag.c b/fs/btrfs/defrag.c
> index e454b59d6477..7b3f779775a0 100644
> --- a/fs/btrfs/defrag.c
> +++ b/fs/btrfs/defrag.c
> @@ -1093,7 +1093,7 @@ static int defrag_collect_targets(struct btrfs_inode *inode,
>  		struct defrag_target_range *tmp;
>  
>  		list_for_each_entry_safe(entry, tmp, target_list, list) {
> -			list_del_init(&entry->list);
> +			list_del(&entry->list);
>  			kfree(entry);
>  		}
>  	}


Nice cleanup.
Reviewed-by: Anand Jain <asj@kernel.org>


  reply	other threads:[~2026-06-25 23:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 19:20 [PATCH 0/6] btrfs: defrag/autodefrag fixes and cleanups fdmanana
2026-06-25 19:20 ` [PATCH 1/6] btrfs: defrag: fix deadlock between defrag and delalloc space reservation fdmanana
2026-06-25 19:20 ` [PATCH 2/6] btrfs: fix pending delayed iputs when using autodefrag fdmanana
2026-06-25 19:20 ` [PATCH 3/6] btrfs: defrag: use a single list for each loop in defrag_one_range() fdmanana
2026-06-25 23:02   ` Anand Suveer Jain
2026-06-25 19:20 ` [PATCH 4/6] btrfs: defrag: use auto kfree in defrag_one_range() for folios array fdmanana
2026-06-25 19:20 ` [PATCH 5/6] btrfs: defrag: use simple list_del() in defrag_collect_targets() fdmanana
2026-06-25 23:10   ` Anand Suveer Jain [this message]
2026-06-25 19:20 ` [PATCH 6/6] btrfs: defrag: remove pointless list_del_init() in defrag_one_cluster() fdmanana
2026-06-25 23:03   ` Anand Suveer Jain
2026-06-25 23:00 ` [PATCH 0/6] btrfs: defrag/autodefrag fixes and cleanups Qu Wenruo

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=8334c67f-c8e2-4800-8f25-b2444c2dcdb7@kernel.org \
    --to=asj@kernel.org \
    --cc=fdmanana@kernel.org \
    --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.