summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2019-08-09 16:49:06 +0200
committerDavid Sterba <dsterba@suse.com>2019-09-09 14:59:11 +0200
commitb0c1fe1eaf5eea10e8d577545298b6d5f9f7ff38 (patch)
tree8d487a078a47357a06992bc8008293fb2bd35c26 /fs/btrfs/compression.h
parente18333a7cb97d838c09802092fcecd3269363ecb (diff)
btrfs: compression: replace set_level callbacks by a common helper
The set_level callbacks do not do anything special and can be replaced by a helper that uses the levels defined in the tables. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.h')
-rw-r--r--fs/btrfs/compression.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index cffd689adb6e..4cb8be9ff88b 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -156,13 +156,6 @@ struct btrfs_compress_op {
unsigned long start_byte,
size_t srclen, size_t destlen);
- /*
- * This bounds the level set by the user to be within range of a
- * particular compression type. It returns the level that will be used
- * if the level is out of bounds or the default if 0 is passed in.
- */
- unsigned int (*set_level)(unsigned int level);
-
/* Maximum level supported by the compression algorithm */
unsigned int max_level;
unsigned int default_level;
@@ -179,6 +172,8 @@ extern const struct btrfs_compress_op btrfs_zstd_compress;
const char* btrfs_compress_type2str(enum btrfs_compression_type type);
bool btrfs_compress_is_valid_type(const char *str, size_t len);
+unsigned int btrfs_compress_set_level(int type, unsigned level);
+
int btrfs_compress_heuristic(struct inode *inode, u64 start, u64 end);
#endif