From patchwork Fri Jul 20 19:12:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mitch Harder X-Patchwork-Id: 1222231 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 040203FD48 for ; Fri, 20 Jul 2012 19:12:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752161Ab2GTTMw (ORCPT ); Fri, 20 Jul 2012 15:12:52 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:49725 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938Ab2GTTMw (ORCPT ); Fri, 20 Jul 2012 15:12:52 -0400 Received: by mail-gh0-f174.google.com with SMTP id r11so4333560ghr.19 for ; Fri, 20 Jul 2012 12:12:51 -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=lNn196InpAP04u02xfqLsFr8NzSgOyNwIFBEnmrjDcKRrHpUUPOXeYVS8eas4t9A2T TgcH5S4Oxa6O626RmB8a9QxGiCnFOLmF6Qk2kZj2BE4VuCvpIknPOaFGuu3Xi3vHPUsD wA5y5ysUoAdWp6rmc3iN9yuHR1aZORH/aMTV+KHsgQQTkzb8qKDdHusBT2HVi09NhpTf CXGBMlnBdQCTXK5fqHOwZpEY2I8M7oA67fB6df1ldDv+iglBcMckY/oPgNpBZO6+AxhC 29M6w1jcdO680j9CRX5XQyfy7NnSDRH7VHkUKkn+IO/w0G0rTeW/EofGl30mbD9IhdS1 a+iQ== Received: by 10.100.80.19 with SMTP id d19mr31094anb.50.1342811571645; Fri, 20 Jul 2012 12:12:51 -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 t22sm5736271anh.20.2012.07.20.12.12.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jul 2012 12:12:51 -0700 (PDT) From: Mitch Harder To: linux-btrfs@vger.kernel.org Cc: Mitch Harder Subject: [PATCH v2 2/2] Btrfs: Use common function to check lzo INCOMPAT on defrag. Date: Fri, 20 Jul 2012 14:12:38 -0500 Message-Id: <1342811558-5303-2-git-send-email-mitch.harder@sabayonlinux.org> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1342811558-5303-1-git-send-email-mitch.harder@sabayonlinux.org> References: <1342811558-5303-1-git-send-email-mitch.harder@sabayonlinux.org> X-Gm-Message-State: ALoCoQnkat5X/DDnpZ18Xrsfq6+qmMFlFnySj2b5b7PqPb9dV6yiUN0ffgdUu5m0Z1V6OsMetfCz 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;