]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: change set_level() to bound the level passed in
authorDennis Zhou <dennis@kernel.org>
Mon, 4 Feb 2019 20:20:05 +0000 (15:20 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 13:13:32 +0000 (14:13 +0100)
commit647be71ca8eae36fc268da6e2f198c91affff316
treea006f0e8aeb45c23b45a405ef9ae1bf630476eae
parent3cb0a0cde212c26850b0f8491ff4ca1d52625c43
btrfs: change set_level() to bound the level passed in

Currently, the only user of set_level() is zlib which sets an internal
workspace parameter. As level is now plumbed into get_workspace(), this
can be handled there rather than separately.

This repurposes set_level() to bound the level passed in so it can be
used when setting the mounts compression level and as well as verifying
the level before getting a workspace. The other benefit is this divides
the meaning of compress(0) and get_workspace(0). The former means we
want to use the default compression level of the compression type. The
latter means we can use any workspace available.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/compression.h
fs/btrfs/lzo.c
fs/btrfs/super.c
fs/btrfs/zlib.c
fs/btrfs/zstd.c