btrfs: add helpers for compression type and level
[sfrench/cifs-2.6.git] / fs / btrfs / compression.h
index ddda9b80bf2044edc3ae210bb401ce8e728fdbe2..004db0b3111b6d54e94a2d1c65483e362df74363 100644 (file)
@@ -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);