提交 93370509 编写于 作者: D David Sterba

btrfs: SETFLAGS ioctl: use helper for compression type conversion

Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 e128f9c3
...@@ -307,12 +307,10 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) ...@@ -307,12 +307,10 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
ip->flags |= BTRFS_INODE_COMPRESS; ip->flags |= BTRFS_INODE_COMPRESS;
ip->flags &= ~BTRFS_INODE_NOCOMPRESS; ip->flags &= ~BTRFS_INODE_NOCOMPRESS;
if (fs_info->compress_type == BTRFS_COMPRESS_LZO) comp = btrfs_compress_type2str(fs_info->compress_type);
comp = "lzo"; if (!comp || comp[0] == 0)
else if (fs_info->compress_type == BTRFS_COMPRESS_ZLIB) comp = btrfs_compress_type2str(BTRFS_COMPRESS_ZLIB);
comp = "zlib";
else
comp = "zstd";
ret = btrfs_set_prop(inode, "btrfs.compression", ret = btrfs_set_prop(inode, "btrfs.compression",
comp, strlen(comp), 0); comp, strlen(comp), 0);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册