btrfs: add helpers for compression type and level
[sfrench/cifs-2.6.git] / fs / btrfs / zlib.c
index 970ff3e35bb345e598854e5767b8c0981bfbb15c..2bd655c4f8b463e92964ac12e9c1fbe348138fd4 100644 (file)
@@ -393,7 +393,7 @@ next:
 static void zlib_set_level(struct list_head *ws, unsigned int type)
 {
        struct workspace *workspace = list_entry(ws, struct workspace, list);
-       unsigned level = (type & 0xF0) >> 4;
+       unsigned int level = btrfs_compress_level(type);
 
        if (level > 9)
                level = 9;