From patchwork Sat May 31 23:48:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Worrall X-Patchwork-Id: 4276801 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 704749F3DF for ; Sat, 31 May 2014 23:49:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DE8A20381 for ; Sat, 31 May 2014 23:49:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C858D202F8 for ; Sat, 31 May 2014 23:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756729AbaEaXsv (ORCPT ); Sat, 31 May 2014 19:48:51 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:49477 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753399AbaEaXst (ORCPT ); Sat, 31 May 2014 19:48:49 -0400 Received: by mail-wi0-f175.google.com with SMTP id f8so2858432wiw.2 for ; Sat, 31 May 2014 16:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nDbqa1lhlh/XwL8MxwO+eMS0K1N69RQWzfACb2cUam4=; b=uQTIPzIiDyBEFOzytinljvikfDR9Y8dlyHNhRIZUHlfEQY8DtQPhSIOjsbzJFxvTBV ++XkoX8jYudbhN+Fb24wVdwbOlyYxWCD+MQ1EnWO7r3AQ1Wp9Zu7rcxxMl/bYMSnBso3 U9SerO3NBD6OgxUANYWmfF/YfZ0Lw3HxhLPhIMHjm04QuT3iwpE55QOQCPgA+EGltKiR 6cr94A36AiAFNQ9aMTMMKZy3AaWH4rWCarDl2cQoAfYJ7+hcQO/suYXNxJYn6JayHxfh y9FmTrEg3tWt3BWP/yoZVtCmW/dVCl949xXoq/r9Z930VwH4geagENp6AXftmydRVYTG yffA== X-Received: by 10.180.206.132 with SMTP id lo4mr10206010wic.46.1401580128528; Sat, 31 May 2014 16:48:48 -0700 (PDT) Received: from ubuntu.home (host86-148-25-253.range86-148.btcentralplus.com. [86.148.25.253]) by mx.google.com with ESMTPSA id em5sm18605440wic.23.2014.05.31.16.48.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 31 May 2014 16:48:47 -0700 (PDT) From: Philip Worrall To: linux-btrfs@vger.kernel.org Cc: Philip Worrall Subject: [PATCH 5/8] Btrfs: Add feature flags for LZ4 support Date: Sat, 31 May 2014 23:48:33 +0000 Message-Id: <1401580116-10458-6-git-send-email-philip.worrall@googlemail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401580116-10458-1-git-send-email-philip.worrall@googlemail.com> References: <1401580116-10458-1-git-send-email-philip.worrall@googlemail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add various feature flags for LZ4 so that older kernels refuse to mount btrfs filesystems that have been used with LZ4 Signed-off-by: Philip Worrall --- fs/btrfs/ctree.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index d8a669e..b5118cfa 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -523,6 +523,7 @@ struct btrfs_super_block { #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) #define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) +#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZ4 (1ULL << 10) #define BTRFS_FEATURE_COMPAT_SUPP 0ULL #define BTRFS_FEATURE_COMPAT_SAFE_SET 0ULL @@ -540,7 +541,8 @@ struct btrfs_super_block { BTRFS_FEATURE_INCOMPAT_RAID56 | \ BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF | \ BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA | \ - BTRFS_FEATURE_INCOMPAT_NO_HOLES) + BTRFS_FEATURE_INCOMPAT_NO_HOLES | \ + BTRFS_FEATURE_INCOMPAT_COMPRESS_LZ4) #define BTRFS_FEATURE_INCOMPAT_SAFE_SET \ (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) @@ -709,8 +711,10 @@ enum btrfs_compression_type { BTRFS_COMPRESS_NONE = 0, BTRFS_COMPRESS_ZLIB = 1, BTRFS_COMPRESS_LZO = 2, - BTRFS_COMPRESS_TYPES = 2, - BTRFS_COMPRESS_LAST = 3, + BTRFS_COMPRESS_LZ4 = 3, + BTRFS_COMPRESS_TYPES = 3, + BTRFS_COMPRESS_LAST = 4, + }; struct btrfs_inode_item {