From: Li Zefan Date: Thu, 26 May 2011 11:39:03 +0800 Patch-mainline: pending References: FATE#306586 Subject: [PATCH] Btrfs: make lzo the default compression scheme As the lzo compression feature has been established for quite a while, we are now ready to replace zlib with lzo as the default compression scheme. Signed-off-by: Li Zefan Signed-off-by: David Sterba --- fs/btrfs/disk-io.c | 2 +- fs/btrfs/ioctl.c | 2 +- fs/btrfs/super.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 94abc25..7ea0cdd 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2095,7 +2095,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, * In the long term, we'll store the compression type in the super * block, and it'll be used for per file compression control. */ - fs_info->compress_type = BTRFS_COMPRESS_ZLIB; + fs_info->compress_type = BTRFS_COMPRESS_LZO; ret = btrfs_parse_options(tree_root, options); if (ret) { diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a90e749..d9c2ba6 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -992,7 +992,7 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, unsigned long ra_index = 0; int ret; int defrag_count = 0; - int compress_type = BTRFS_COMPRESS_ZLIB; + int compress_type = BTRFS_COMPRESS_LZO; int extent_thresh = range->extent_thresh; int max_cluster = (256 * 1024) >> PAGE_CACHE_SHIFT; int cluster = max_cluster; diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8bd9d6d..b6b5bd7 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -270,12 +270,12 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) case Opt_compress_type: if (token == Opt_compress || token == Opt_compress_force || - strcmp(args[0].from, "zlib") == 0) { - compress_type = "zlib"; - info->compress_type = BTRFS_COMPRESS_ZLIB; - } else if (strcmp(args[0].from, "lzo") == 0) { + strcmp(args[0].from, "lzo") == 0) { compress_type = "lzo"; info->compress_type = BTRFS_COMPRESS_LZO; + } else if (strcmp(args[0].from, "zlib") == 0) { + compress_type = "zlib"; + info->compress_type = BTRFS_COMPRESS_ZLIB; } else { ret = -EINVAL; goto out; -- 1.7.6