Re: [PATCH 5/6] btrfs: defrag: use simple list_del() in defrag_collect_targets()

Anand Suveer Jain <[email protected]>
Newsgroups org.kernel.vger.linux-btrfs
Message-ID <[email protected]>
On 26/6/26 03:20, [email protected] wrote:
> From: Filipe Manana <[email protected]>
> 
> 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 <[email protected]>
> ---
>  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 <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.