Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
[sfrench/cifs-2.6.git] / fs / btrfs / props.c
index 09c0266f248d07737436b655cea98f6e93e15f37..f6a05f8366297ef791f74de39f2a884972dfb7a7 100644 (file)
@@ -390,6 +390,8 @@ static int prop_compression_validate(const char *value, size_t len)
                return 0;
        else if (!strncmp("zlib", value, len))
                return 0;
+       else if (!strncmp("zstd", value, len))
+               return 0;
 
        return -EINVAL;
 }
@@ -412,6 +414,8 @@ static int prop_compression_apply(struct inode *inode,
                type = BTRFS_COMPRESS_LZO;
        else if (!strncmp("zlib", value, 4))
                type = BTRFS_COMPRESS_ZLIB;
+       else if (!strncmp("zstd", value, len))
+               type = BTRFS_COMPRESS_ZSTD;
        else
                return -EINVAL;
 
@@ -429,6 +433,8 @@ static const char *prop_compression_extract(struct inode *inode)
                return "zlib";
        case BTRFS_COMPRESS_LZO:
                return "lzo";
+       case BTRFS_COMPRESS_ZSTD:
+               return "zstd";
        }
 
        return NULL;