On Fri, Dec 20, 2019 at 11:34 PM Qu Wenruo <quwenruo.btrfs@xxxxxxx> wrote:
>
>
>
> On 2019/12/21 下午2:27, Chris Murphy wrote:
> > kernel 5.4.5
> > btrfs-progs 5.4
> >
> > test file is linux.tar (not compressed), it's the only file on the
> > file system in each case
> >
> > /dev/sda5 53G 2.8G 50G 6% /mnt none
> > /dev/sda5 53G 2.2G 50G 5% /mnt zstd 1
> > /dev/sda5 53G 2.1G 50G 4% /mnt zstd 15
> >
> >
> > mount and dmesg both show the value for the level I've set; but btrfs
> > insp dump-t shows extents always have compression 3.
> >
> >
> > [47567.500812] BTRFS info (device sda5): use zstd compression, level 1
> >
> > item 14 key (328583 EXTENT_DATA 2060582912) itemoff 15488 itemsize 53
> > generation 51 type 1 (regular)
> > extent data disk byte 6461308928 nr 20480
> > extent data offset 0 nr 131072 ram 131072
> > extent compression 3 (zstd)
>
> This number is not compression level, but compression algorithm.
>
> typedef enum {
> BTRFS_COMPRESS_NONE = 0,
> BTRFS_COMPRESS_ZLIB = 1,
> BTRFS_COMPRESS_LZO = 2,
> BTRFS_COMPRESS_ZSTD = 3,
> BTRFS_COMPRESS_TYPES = 3,
> BTRFS_COMPRESS_LAST = 4,
> } btrfs_compression_type;
>
> Level is not recorded in that field.
Oh lovely, that's embarrassing. Thanks for the answer!
--
Chris Murphy