From patchwork Thu May 26 03:39:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zefan X-Patchwork-Id: 819302 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4Q3ZFPE028864 for ; Thu, 26 May 2011 03:35:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755915Ab1EZDfL (ORCPT ); Wed, 25 May 2011 23:35:11 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:55580 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755567Ab1EZDfK (ORCPT ); Wed, 25 May 2011 23:35:10 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 1681F170153 for ; Thu, 26 May 2011 11:35:07 +0800 (CST) Received: from mailserver.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id p4Q3Z66D029325 for ; Thu, 26 May 2011 11:35:06 +0800 Received: from [10.167.225.230] ([10.167.225.230]) by mailserver.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2011052611350806-397640 ; Thu, 26 May 2011 11:35:08 +0800 Message-ID: <4DDDCB57.6090405@cn.fujitsu.com> Date: Thu, 26 May 2011 11:39:03 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc14 Thunderbird/3.1.4 MIME-Version: 1.0 To: "linux-btrfs@vger.kernel.org" Subject: [PATCH] Btrfs: make lzo the default compression scheme X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-05-26 11:35:08, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-05-26 11:35:08, Serialize complete at 2011-05-26 11:35:08 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 26 May 2011 03:35:15 +0000 (UTC) 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 --- 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 16d335b..17c9e3a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1753,7 +1753,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 c4f17e4..a86cc2d 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -747,7 +747,7 @@ static int btrfs_defrag_file(struct file *file, u64 defrag_end = 0; unsigned long i; int ret; - int compress_type = BTRFS_COMPRESS_ZLIB; + int compress_type = BTRFS_COMPRESS_LZO; if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) { if (range->compress_type > BTRFS_COMPRESS_TYPES) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index cd0c7cd..ab9fd9c 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -257,12 +257,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;