diff options
| author | Daniel Vacek <neelx@suse.com> | 2025-03-06 14:15:35 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-03-18 20:35:50 +0100 |
| commit | fc5c0c5825874859069ac44c367c724acd7190fb (patch) | |
| tree | 3b3e5fb0a15f714baa7ff7a786c56ee2d3861be1 /include/uapi | |
| parent | btrfs: send: simplify return logic from send_encoded_extent() (diff) | |
| download | linux-fc5c0c5825874859069ac44c367c724acd7190fb.tar.gz linux-fc5c0c5825874859069ac44c367c724acd7190fb.zip | |
btrfs: defrag: extend ioctl to accept compression levels
The zstd and zlib compression types support setting compression levels.
Enhance the defrag interface to specify the levels as well. For zstd the
negative (realtime) levels are also accepted.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/uapi')
| -rw-r--r-- | include/uapi/linux/btrfs.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h index d3b222d7af24..dd02160015b2 100644 --- a/include/uapi/linux/btrfs.h +++ b/include/uapi/linux/btrfs.h @@ -615,7 +615,9 @@ struct btrfs_ioctl_clone_range_args { */ #define BTRFS_DEFRAG_RANGE_COMPRESS 1 #define BTRFS_DEFRAG_RANGE_START_IO 2 +#define BTRFS_DEFRAG_RANGE_COMPRESS_LEVEL 4 #define BTRFS_DEFRAG_RANGE_FLAGS_SUPP (BTRFS_DEFRAG_RANGE_COMPRESS | \ + BTRFS_DEFRAG_RANGE_COMPRESS_LEVEL | \ BTRFS_DEFRAG_RANGE_START_IO) struct btrfs_ioctl_defrag_range_args { @@ -640,10 +642,18 @@ struct btrfs_ioctl_defrag_range_args { /* * which compression method to use if turning on compression - * for this defrag operation. If unspecified, zlib will - * be used + * for this defrag operation. If unspecified, zlib will be + * used. If compression level is also being specified, set the + * BTRFS_DEFRAG_RANGE_COMPRESS_LEVEL flag and fill the compress + * member structure instead of the compress_type field. */ - __u32 compress_type; + union { + __u32 compress_type; + struct { + __u8 type; + __s8 level; + } compress; + }; /* spare for later */ __u32 unused[4]; |
