Commit 93370509 authored by David Sterba's avatar David Sterba

btrfs: SETFLAGS ioctl: use helper for compression type conversion

Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e128f9c3
......@@ -307,12 +307,10 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
ip->flags |= BTRFS_INODE_COMPRESS;
ip->flags &= ~BTRFS_INODE_NOCOMPRESS;
if (fs_info->compress_type == BTRFS_COMPRESS_LZO)
comp = "lzo";
else if (fs_info->compress_type == BTRFS_COMPRESS_ZLIB)
comp = "zlib";
else
comp = "zstd";
comp = btrfs_compress_type2str(fs_info->compress_type);
if (!comp || comp[0] == 0)
comp = btrfs_compress_type2str(BTRFS_COMPRESS_ZLIB);
ret = btrfs_set_prop(inode, "btrfs.compression",
comp, strlen(comp), 0);
if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment