Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: fdmanana@kernel.org, fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] common/btrfs: exercise all algorithms in _btrfs_stress_defrag()
Date: Wed, 16 Sep 2026 07:49:14 +0930	[thread overview]
Message-ID: <45c16e73-22da-4f18-b96a-11572bb7333d@suse.com> (raw)
In-Reply-To: <97cbd58be421a2b35567031d58002f73493b3316.1789486109.git.fdmanana@suse.com>



在 2026/9/16 00:59, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
> 
> _btrfs_stress_defrag() is testing only zlib and lzo compression with the
> defrag tool, but we also have zstd support for some years now.
> 
> Change _btrfs_stress_defrag() to iterate over the list of all supported
> compression algorithms given by _btrfs_compression_algos().
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   common/btrfs | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/common/btrfs b/common/btrfs
> index 3eb68beb..1854cf07 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -414,16 +414,17 @@ _btrfs_stress_defrag()
>   {
>   	local btrfs_mnt=$1
>   	local compress=$2
> +	local algo_list=($(_btrfs_compression_algos))
>   
>   	while true; do
>   		if [ "$compress" == "nocompress" ]; then
>   			find $btrfs_mnt \( -type f -o -type d \) -exec \
>   			$BTRFS_UTIL_PROG filesystem defrag {} \;
>   		else
> -			find $btrfs_mnt \( -type f -o -type d \) -exec \
> -			$BTRFS_UTIL_PROG filesystem defrag -clzo {} \;
> -			find $btrfs_mnt \( -type f -o -type d \) -exec \
> -			$BTRFS_UTIL_PROG filesystem defrag -czlib {} \;
> +			for algo in ${algo_list[@]}; do
> +				find $btrfs_mnt \( -type f -o -type d \) -exec \
> +				     $BTRFS_UTIL_PROG filesystem defrag -c$algo {} \;
> +			done
>   		fi
>   	done
>   }


      reply	other threads:[~2026-09-15 22:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 15:29 [PATCH] common/btrfs: exercise all algorithms in _btrfs_stress_defrag() fdmanana
2026-09-15 22:19 ` Qu Wenruo [this message]

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=45c16e73-22da-4f18-b96a-11572bb7333d@suse.com \
    --to=wqu@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox