linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz, calestyo@scientia.net, ahferroin7@gmail.com,
	1i5t5.duncan@cox.net
Subject: [PATCH 2/7] btrfs-progs: add kernel alias for each of the features in the list
Date: Wed, 25 Nov 2015 20:08:15 +0800	[thread overview]
Message-ID: <1448453300-8449-3-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1448453300-8449-1-git-send-email-anand.jain@oracle.com>

We should have maintained feature's name same across progs UI and sysfs UI.
For example, progs mixed-bg is /sys/fs/btrfs/features/mixed_groups
in sysfs. As these are already released and is UIs, there is nothing much
can be done about it, except for creating the alias and making it aware.

Add kernel alias for each of the features in the list.

eg: The string with in () is the sysfs name for the same feaure

mkfs.btrfs -O list-all
Filesystem features available:
mixed-bg (mixed_groups)           - mixed data and metadata block groups (0x4, 2.7.37)
extref (extended_iref)            - increased hardlink limit per file to 65536 (0x40, 3.7, default)
raid56 (raid56)                   - raid56 extended format (0x80, 3.9)
skinny-metadata (skinny_metadata) - reduced-size metadata extent refs (0x100, 3.10, default)
no-holes (no_holes)               - no explicit hole extents for files (0x200, 3.14)

btrfs-convert -O list-all
Filesystem features available:
extref (extended_iref)            - increased hardlink limit per file to 65536 (0x40, 3.7, default)
skinny-metadata (skinny_metadata) - reduced-size metadata extent refs (0x100, 3.10, default)
no-holes (no_holes)               - no explicit hole extents for files (0x200, 3.14)
---
 utils.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/utils.c b/utils.c
index 0163915..6d2675d 100644
--- a/utils.c
+++ b/utils.c
@@ -648,17 +648,26 @@ void btrfs_process_fs_features(u64 flags)
 void btrfs_list_all_fs_features(u64 mask_disallowed)
 {
 	int i;
+	u64 feature_per_sysfs;
+
+	btrfs_features_allowed_by_sysfs(&feature_per_sysfs);
 
 	fprintf(stderr, "Filesystem features available:\n");
 	for (i = 0; i < ARRAY_SIZE(mkfs_features) - 1; i++) {
 		char *is_default = "";
+		char name[256];
 
 		if (mkfs_features[i].flag & mask_disallowed)
 			continue;
 		if (mkfs_features[i].flag & BTRFS_MKFS_DEFAULT_FEATURES)
 			is_default = ", default";
-		fprintf(stderr, "%-20s- %s (0x%llx, %s%s)\n",
-				mkfs_features[i].name,
+		if (mkfs_features[i].flag & feature_per_sysfs)
+			sprintf(name, "%s (%s)",
+				mkfs_features[i].name, mkfs_features[i].name_ker);
+		else
+			sprintf(name, "%s", mkfs_features[i].name);
+		fprintf(stderr, "%-34s- %s (0x%llx, %s%s)\n",
+				name,
 				mkfs_features[i].desc,
 				mkfs_features[i].flag,
 				mkfs_features[i].min_ker_ver,
-- 
2.6.2


  parent reply	other threads:[~2015-11-25 12:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 12:08 [PATCH 0/7] Let user specify the kernel version for features Anand Jain
2015-11-25 12:08 ` [PATCH 1/7] btrfs-progs: show the version for -O list-all Anand Jain
2015-11-25 12:08 ` Anand Jain [this message]
2015-11-25 13:36   ` [PATCH V1.1 2/7] btrfs-progs: add kernel alias for each of the features in the list Anand Jain
2015-11-25 18:11   ` [PATCH " Liu Bo
2015-11-25 22:52     ` Anand Jain
2015-11-25 12:08 ` [PATCH 3/7] btrfs-progs: make is_numerical non static Anand Jain
2015-11-25 12:08 ` [PATCH 4/7] btrfs-progs: check for numerical in version_to_code() Anand Jain
2015-11-25 12:08 ` [PATCH 5/7] btrfs-progs: introduce framework version to features Anand Jain
2015-11-25 12:08 ` [PATCH 6/7] btrfs-progs: add -O comp= option for mkfs.btrfs Anand Jain
2015-11-25 12:08 ` [PATCH 7/7] btrfs-progs: add -O comp= option for btrfs-convert Anand Jain
2015-11-26  2:02 ` [PATCH 0/7] Let user specify the kernel version for features Qu Wenruo
2015-11-26  6:07   ` Anand Jain
2015-11-26  6:53     ` Qu Wenruo
2015-11-26 11:18       ` Anand Jain
2015-11-26 12:31         ` Qu Wenruo
2015-11-26 22:17           ` Anand Jain
2015-11-27  0:44             ` Qu Wenruo
2015-11-27  8:41               ` Anand Jain
2015-11-29  1:21                 ` Qu Wenruo
2015-11-30  4:54                   ` Anand Jain
2015-11-30  5:46                     ` Qu Wenruo
2016-02-03 10:50                       ` David Sterba
2016-02-04  1:12                         ` Qu Wenruo
2016-02-04  1:42                         ` Chris Mason
2015-11-30  5:44       ` potential btrfs-progs clean up Anand Jain
2015-11-30  6:12         ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448453300-8449-3-git-send-email-anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=1i5t5.duncan@cox.net \
    --cc=ahferroin7@gmail.com \
    --cc=calestyo@scientia.net \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).