X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=blobdiff_plain;f=fs%2Fbtrfs%2Fcompression.h;h=9a0e73c65b871ccf323420a4f3b865215f64a4f2;hp=ddda9b80bf2044edc3ae210bb401ce8e728fdbe2;hb=ca4ac360af94964906149efe166453ac83ae7c43;hpb=c74a7469f97c0f40b46e82ee979f9fb1bb6e847c diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h index ddda9b80bf20..9a0e73c65b87 100644 --- a/fs/btrfs/compression.h +++ b/fs/btrfs/compression.h @@ -64,6 +64,16 @@ struct compressed_bio { u32 sums; }; +static inline unsigned int btrfs_compress_type(unsigned int type_level) +{ + return (type_level & 0xF); +} + +static inline unsigned int btrfs_compress_level(unsigned int type_level) +{ + return ((type_level & 0xF0) >> 4); +} + void __init btrfs_init_compress(void); void __cold btrfs_exit_compress(void); @@ -122,6 +132,10 @@ struct btrfs_compress_op { void (*set_level)(struct list_head *ws, unsigned int type); }; +/* The heuristic workspaces are managed via the 0th workspace manager */ +#define BTRFS_NR_WORKSPACE_MANAGERS (BTRFS_COMPRESS_TYPES + 1) + +extern const struct btrfs_compress_op btrfs_heuristic_compress; extern const struct btrfs_compress_op btrfs_zlib_compress; extern const struct btrfs_compress_op btrfs_lzo_compress; extern const struct btrfs_compress_op btrfs_zstd_compress;