From patchwork Thu Sep 10 02:34:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 7150151 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29072BEEC1 for ; Thu, 10 Sep 2015 02:40:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AF0E209C9 for ; Thu, 10 Sep 2015 02:40:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 553F2209C7 for ; Thu, 10 Sep 2015 02:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753595AbbIJChn (ORCPT ); Wed, 9 Sep 2015 22:37:43 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:45126 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754393AbbIJCgZ (ORCPT ); Wed, 9 Sep 2015 22:36:25 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100544452" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 10 Sep 2015 10:39:19 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t8A2aAGK007715; Thu, 10 Sep 2015 10:36:10 +0800 Received: from localhost.localdomain (10.167.226.33) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 10 Sep 2015 10:36:22 +0800 From: Qu Wenruo To: CC: Subject: [PATCH v2 4/5] btrfs-progs: util: add parameter for btrfs_list_all_fs_features Date: Thu, 10 Sep 2015 10:34:17 +0800 Message-ID: <1441852458-10289-5-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1441852458-10289-1-git-send-email-quwenruo@cn.fujitsu.com> References: <1441852458-10289-1-git-send-email-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.33] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Even we tried to make mkfs and btrfs-convert use the same features, but previous patch forced btrfs-convert to use mix-bg feature. So the default fs features is different for mkfs and btrfs-convert, add mask_default parameter for btrfs_list_all_fs_features() to handle the difference. Signed-off-by: Qu Wenruo --- btrfs-convert.c | 4 +++- mkfs.c | 3 ++- utils.c | 4 ++-- utils.h | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c index a60f380..e730e4b 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -2950,7 +2950,9 @@ int main(int argc, char *argv[]) } if (features & BTRFS_FEATURE_LIST_ALL) { btrfs_list_all_fs_features( - ~BTRFS_CONVERT_ALLOWED_FEATURES); + ~BTRFS_CONVERT_ALLOWED_FEATURES, + BTRFS_MKFS_DEFAULT_FEATURES | + BTRFS_CONVERT_FORCE_FEATURES); exit(0); } diff --git a/mkfs.c b/mkfs.c index b8879fc..56ce381 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1430,7 +1430,8 @@ int main(int ac, char **av) } free(orig); if (features & BTRFS_FEATURE_LIST_ALL) { - btrfs_list_all_fs_features(0); + btrfs_list_all_fs_features(0, + BTRFS_MKFS_DEFAULT_FEATURES); exit(0); } break; diff --git a/utils.c b/utils.c index c0d1afa..78ba67b 100644 --- a/utils.c +++ b/utils.c @@ -633,7 +633,7 @@ void btrfs_process_fs_features(u64 flags) } } -void btrfs_list_all_fs_features(u64 mask_disallowed) +void btrfs_list_all_fs_features(u64 mask_disallowed, u64 mask_default) { int i; @@ -643,7 +643,7 @@ void btrfs_list_all_fs_features(u64 mask_disallowed) if (mkfs_features[i].flag & mask_disallowed) continue; - if (mkfs_features[i].flag & BTRFS_MKFS_DEFAULT_FEATURES) + if (mkfs_features[i].flag & mask_default) is_default = ", default"; fprintf(stderr, "%-20s- %s (0x%llx%s)\n", mkfs_features[i].name, diff --git a/utils.h b/utils.h index 7f1a128..f8fd745 100644 --- a/utils.h +++ b/utils.h @@ -112,7 +112,7 @@ void set_argv0(char **argv); void units_set_mode(unsigned *units, unsigned mode); void units_set_base(unsigned *units, unsigned base); -void btrfs_list_all_fs_features(u64 mask_disallowed); +void btrfs_list_all_fs_features(u64 mask_disallowed, u64 mask_default); char* btrfs_parse_fs_features(char *namelist, u64 *flags); void btrfs_process_fs_features(u64 flags); void btrfs_parse_features_to_string(char *buf, u64 flags);