From patchwork Fri Jul 20 17:36:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mitch Harder X-Patchwork-Id: 1221871 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 85357E0038 for ; Fri, 20 Jul 2012 17:36:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753021Ab2GTRgq (ORCPT ); Fri, 20 Jul 2012 13:36:46 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:43122 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954Ab2GTRgp (ORCPT ); Fri, 20 Jul 2012 13:36:45 -0400 Received: by ghrr11 with SMTP id r11so4237209ghr.19 for ; Fri, 20 Jul 2012 10:36:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Mz3GKRb4PUAhI1a35MSoGwrLjy9aEx7wwICPrG+ZPWw=; b=PDOdTpP3+iuFAuJEfy1RDCk1PiSQD5/d9vOh1RJrmdMQwewfXlImec2ZgJE6YtVkKt 4bjH4YM460bFEFaTQlpnH8ABjIQRnohqm2P0NEc6NJa/4LgXODd6tPdJP7kfOcFE+f1Q Eq9DThAeV0aMKozpap8K1if3S04bYYmFsB/GiTDN0IwAoGj6sMCFp9wvRFXW1+D1T8fh Klraq9JUBBPsHkW2PDwXSG7mTtVz00qQzYMJ2RJns9VLfyraVBr216cAOXLMo/U2JYla G4Ur9DrJuHcquYSREgt5Iw7FQW7Ldm21knCPJe+Xzk6Kgk5buPUQlxWA/PjEcHzX/Xkr NQIA== Received: by 10.236.154.165 with SMTP id h25mr6248383yhk.38.1342805805322; Fri, 20 Jul 2012 10:36:45 -0700 (PDT) Received: from zero-p.gateway.2wire.net (108-84-253-144.lightspeed.moblal.sbcglobal.net. [108.84.253.144]) by mx.google.com with ESMTPS id l13sm5514873ann.2.2012.07.20.10.36.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jul 2012 10:36:44 -0700 (PDT) From: Mitch Harder To: linux-btrfs@vger.kernel.org Cc: Mitch Harder Subject: [PATCH 2/2] Btrfs: Use common function to check lzo INCOMPAT on defrag. Date: Fri, 20 Jul 2012 12:36:21 -0500 Message-Id: <1342805781-12162-3-git-send-email-mitch.harder@sabayonlinux.org> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1342805781-12162-1-git-send-email-mitch.harder@sabayonlinux.org> References: <1342805781-12162-1-git-send-email-mitch.harder@sabayonlinux.org> X-Gm-Message-State: ALoCoQng1CW7db9g0DM6vPjDtC1zvbsu8akacUmWLS0wQoCKfjfxqZvRJ+vDCnEAPnRrWVue2Q1w Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org When defragmenting with explicit lzo compression, simplify the check for lzo INCOMPAT by using the new common function introduced to support remounting with lzo compression. Signed-off-by: Mitch Harder --- fs/btrfs/ioctl.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 17facea..d5fd69e 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1042,11 +1042,9 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, u64 newer_than, unsigned long max_to_defrag) { struct btrfs_root *root = BTRFS_I(inode)->root; - struct btrfs_super_block *disk_super; struct file_ra_state *ra = NULL; unsigned long last_index; u64 isize = i_size_read(inode); - u64 features; u64 last_len = 0; u64 skip = 0; u64 defrag_end = 0; @@ -1233,11 +1231,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, mutex_unlock(&inode->i_mutex); } - disk_super = root->fs_info->super_copy; - features = btrfs_super_incompat_flags(disk_super); if (range->compress_type == BTRFS_COMPRESS_LZO) { - features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO; - btrfs_set_super_incompat_flags(disk_super, features); + btrfs_chk_lzo_incompat(root); } ret = defrag_count;