All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command
@ 2014-12-15 20:02 Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 1/7] Add -v -q switches to mkfs.btrfs Goffredo Baroncelli
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:02 UTC (permalink / raw)
  To: linux-btrfs



Hi All,

enclosed a patches set to improve the output of mkfs.btrfs command.

Currently I find the output of mkfs.btrfs command quite confusing:

# mkfs.btrfs -f -M -d raid5 -m raid5 /dev/vd[b-k] 

Btrfs v3.17
See http://btrfs.wiki.kernel.org for more information.

Turning ON incompat feature 'mixed-bg': mixed data and metadata block groups
Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
Turning ON incompat feature 'raid56': raid56 extended format
Created a data/metadata chunk of size 8388608
adding device /dev/vdc id 2
adding device /dev/vdd id 3
adding device /dev/vde id 4
adding device /dev/vdf id 5
adding device /dev/vdg id 6
adding device /dev/vdh id 7
adding device /dev/vdi id 8
adding device /dev/vdj id 9
adding device /dev/vdk id 10
fs created label (null) on /dev/vdb
	nodesize 4096 leafsize 4096 sectorsize 4096 size 356.01GiB

After my patches the output becomes:

# mkfs.btrfs -f -d raid5 -m raid5 /dev/vd[b-k] 
BTRFS filesystem summary:
  Label:		btrfs-test
  UUID:			1073cb19-b675-423d-9aba-caad7f1508a8

  Node size:		16384
  Leaf size:		16384
  Sector size:		4096
  Initial chunks:
    Data:		9.01GiB
    Metadata:		3.61GiB
    System:		18.06MiB
  Metadata profile:	RAID5
  Data profile:		RAID5
  Mixed mode:		NO
  SSD detected:		NO
  Features:		extref, raid56
  Number of devices:	10
    UUID                                  ID    SIZE    PATH
    ------------------------------------  --  --------- -----------
    62121322-5666-4ecf-bc8e-c9b3d9f60db9   1   50.00GiB /dev/vdb
    6158cb13-3ae8-42b6-8603-660f1e5c8a7a   2   50.00GiB /dev/vdc
    b49516db-ddf5-4f54-8831-a4babc79e901   3   50.00GiB /dev/vdd
    00b03d81-7d29-4894-8050-9dd205f97c41   4   50.00GiB /dev/vde
    f119a2ec-5ef0-436c-805e-c1b0612b05ca   5   50.00GiB /dev/vdf
    adee4f58-e094-4bd4-8c56-941527524f8d   6   50.00GiB /dev/vdg
    a8299171-2024-4057-ba56-1f83bf6d7e2e   7   50.00GiB /dev/vdh
    b694e275-e454-4dbd-beb0-e33c388cffa2   8    2.00GiB /dev/vdi
    7cbe04b5-36cd-4ea7-be82-206d5487914e   9    2.00GiB /dev/vdj
    7c320654-675e-456b-ac23-cfb148b8ea57  10    2.00GiB /dev/vdk

  Total disks size:                           356.01GiB


Each information is in its own row. The disks are listed with more
information (disk uuid, id, size of each disk...)
Nodesize, Leafsize, Sectorsize are separated by the filesystem size.

The metadata/data profile are displayed (before this information was missed).
Also the size of the data/metadata/system chunk are displayed.

This is an RFC to collect suggestions.


These changes are also available via github
https://github.com/kreijack/btrfs-progs/commit/44fc80342b9c238f41b803cb0b9b4efe9b66d56f


BR
G.Baroncelli



-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/7] Add -v -q switches to mkfs.btrfs.
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
@ 2014-12-15 20:02 ` Goffredo Baroncelli
  2014-12-16  4:56   ` Satoru Takeuchi
  2014-12-15 20:02 ` [PATCH 2/7] Move group_profile_str() in utils.c Goffredo Baroncelli
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goffredo Baroncelli

Add -v -q switches to mkfs.btrfs, to control the verbosity of mkfs.btrfs.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 mkfs.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/mkfs.c b/mkfs.c
index e10e62d..26f8041 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -288,8 +288,10 @@ static void print_usage(void)
 	fprintf(stderr, "\t -r --rootdir the source directory\n");
 	fprintf(stderr, "\t -K --nodiscard do not perform whole device TRIM\n");
 	fprintf(stderr, "\t -O --features comma separated list of filesystem features\n");
+	fprintf(stderr, "\t -q --quiet enable quiet mode\n");
 	fprintf(stderr, "\t -U --uuid specify the filesystem UUID\n");
 	fprintf(stderr, "\t -V --version print the mkfs.btrfs version and exit\n");
+	fprintf(stderr, "\t -v --verbose enable verbose mode\n");
 	fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
 	exit(1);
 }
@@ -351,6 +353,8 @@ static struct option long_options[] = {
 	{ "version", 0, NULL, 'V' },
 	{ "rootdir", 1, NULL, 'r' },
 	{ "nodiscard", 0, NULL, 'K' },
+	{ "verbose", 0, NULL, 'v' },
+	{ "quiet", 0, NULL, 'q' },
 	{ "features", 1, NULL, 'O' },
 	{ "uuid", required_argument, NULL, 'U' },
 	{ NULL, 0, NULL, 0}
@@ -998,7 +1002,7 @@ out:
  * This ignores symlinks with unreadable targets and subdirs that can't
  * be read.  It's a best-effort to give a rough estimate of the size of
  * a subdir.  It doesn't guarantee that prepopulating btrfs from this
- * tree won't still run out of space. 
+ * tree won't still run out of space.
  *
  * The rounding up to 4096 is questionable.  Previous code used du -B 4096.
  */
@@ -1266,6 +1270,8 @@ int main(int ac, char **av)
 	int discard = 1;
 	int ssd = 0;
 	int force_overwrite = 0;
+	int verbose = 0;
+	int quiet = 0;
 
 	char *source_dir = NULL;
 	int source_dir_set = 0;
@@ -1355,6 +1361,12 @@ int main(int ac, char **av)
 			case 'K':
 				discard = 0;
 				break;
+			case 'v':
+				verbose = 1;
+				break;
+			case 'q':
+				quiet = 1;
+				break;
 			default:
 				print_usage();
 		}
@@ -1387,7 +1399,7 @@ int main(int ac, char **av)
 			exit(1);
 		}
 	}
-	
+
 	while (dev_cnt-- > 0) {
 		file = av[optind++];
 		if (is_block_device(file))
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/7] Move group_profile_str() in utils.c
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 1/7] Add -v -q switches to mkfs.btrfs Goffredo Baroncelli
@ 2014-12-15 20:02 ` Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 3/7] Add verbose option to btrfs_add_to_fsid() Goffredo Baroncelli
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goffredo Baroncelli

Move the group_profile_str() function from cmds-filesystem.c to utils.c
to be re-used from other modules (in this case from mkfs.c)

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 cmds-filesystem.c | 22 ----------------------
 utils.c           | 22 ++++++++++++++++++++++
 utils.h           |  2 ++
 3 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 253f105..d1afeba 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -157,28 +157,6 @@ static char *group_type_str(u64 flag)
 	}
 }
 
-static char *group_profile_str(u64 flag)
-{
-	switch (flag & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
-	case 0:
-		return "single";
-	case BTRFS_BLOCK_GROUP_RAID0:
-		return "RAID0";
-	case BTRFS_BLOCK_GROUP_RAID1:
-		return "RAID1";
-	case BTRFS_BLOCK_GROUP_RAID5:
-		return "RAID5";
-	case BTRFS_BLOCK_GROUP_RAID6:
-		return "RAID6";
-	case BTRFS_BLOCK_GROUP_DUP:
-		return "DUP";
-	case BTRFS_BLOCK_GROUP_RAID10:
-		return "RAID10";
-	default:
-		return "unknown";
-	}
-}
-
 static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret)
 {
 	u64 count = 0;
diff --git a/utils.c b/utils.c
index 2a92416..19049bb 100644
--- a/utils.c
+++ b/utils.c
@@ -2450,3 +2450,25 @@ int find_next_key(struct btrfs_path *path, struct btrfs_key *key)
 	}
 	return 1;
 }
+
+char *group_profile_str(u64 flag)
+{
+	switch (flag & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
+	case 0:
+		return "single";
+	case BTRFS_BLOCK_GROUP_RAID0:
+		return "RAID0";
+	case BTRFS_BLOCK_GROUP_RAID1:
+		return "RAID1";
+	case BTRFS_BLOCK_GROUP_RAID5:
+		return "RAID5";
+	case BTRFS_BLOCK_GROUP_RAID6:
+		return "RAID6";
+	case BTRFS_BLOCK_GROUP_DUP:
+		return "DUP";
+	case BTRFS_BLOCK_GROUP_RAID10:
+		return "RAID10";
+	default:
+		return "unknown";
+	}
+}
diff --git a/utils.h b/utils.h
index 289e86b..bb8a449 100644
--- a/utils.h
+++ b/utils.h
@@ -161,4 +161,6 @@ static inline u64 btrfs_min_dev_size(u32 leafsize)
 
 int find_next_key(struct btrfs_path *path, struct btrfs_key *key);
 
+char *group_profile_str(u64 flag);
+
 #endif
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/7] Add verbose option to btrfs_add_to_fsid()
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 1/7] Add -v -q switches to mkfs.btrfs Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 2/7] Move group_profile_str() in utils.c Goffredo Baroncelli
@ 2014-12-15 20:02 ` Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 4/7] Add strdup in btrfs_add_to_fsid() to track the device path Goffredo Baroncelli
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goffredo Baroncelli

Add verbose option to btrfs_add_to_fsid() in order to avoid to print
the information to console when not needed.
The same information is print in the summary of the mkfs.btrfs command.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 utils.c | 7 ++++---
 utils.h | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/utils.c b/utils.c
index 19049bb..dcb4f74 100644
--- a/utils.c
+++ b/utils.c
@@ -610,7 +610,7 @@ static int zero_dev_clamped(int fd, off_t start, ssize_t len, u64 dev_size)
 int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
 		      struct btrfs_root *root, int fd, char *path,
 		      u64 block_count, u32 io_width, u32 io_align,
-		      u32 sectorsize)
+		      u32 sectorsize, int verbose)
 {
 	struct btrfs_super_block *disk_super;
 	struct btrfs_super_block *super = root->fs_info->super_copy;
@@ -659,8 +659,9 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
 
 	memcpy(disk_super, super, sizeof(*disk_super));
 
-	printf("adding device %s id %llu\n", path,
-	       (unsigned long long)device->devid);
+	if (verbose)
+		printf("adding device %s id %llu\n", path,
+		       (unsigned long long)device->devid);
 
 	btrfs_set_super_bytenr(disk_super, BTRFS_SUPER_INFO_OFFSET);
 	btrfs_set_stack_device_id(dev_item, device->devid);
diff --git a/utils.h b/utils.h
index bb8a449..9218199 100644
--- a/utils.h
+++ b/utils.h
@@ -79,7 +79,7 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
 int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
 		      struct btrfs_root *root, int fd, char *path,
 		      u64 block_count, u32 io_width, u32 io_align,
-		      u32 sectorsize);
+		      u32 sectorsize, int verbose);
 int btrfs_scan_for_fsid(int run_ioctls);
 int btrfs_register_one_device(const char *fname);
 int btrfs_register_all_devices(void);
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/7] Add strdup in btrfs_add_to_fsid() to track the device path.
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
                   ` (2 preceding siblings ...)
  2014-12-15 20:02 ` [PATCH 3/7] Add verbose option to btrfs_add_to_fsid() Goffredo Baroncelli
@ 2014-12-15 20:02 ` Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 5/7] Return the fsid from make_btrfs() Goffredo Baroncelli
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goffredo Baroncelli

When creating a new btrfs_device, copy the path to track it.
This path is then used by mkfs.btrfs to list all devices.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils.c b/utils.c
index dcb4f74..3f50e4d 100644
--- a/utils.c
+++ b/utils.c
@@ -647,6 +647,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
 	device->bytes_used = 0;
 	device->total_ios = 0;
 	device->dev_root = root->fs_info->dev_root;
+	device->name = strdup(path);
 
 	ret = btrfs_add_device(trans, root, device);
 	BUG_ON(ret);
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/7] Return the fsid from make_btrfs()
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
                   ` (3 preceding siblings ...)
  2014-12-15 20:02 ` [PATCH 4/7] Add strdup in btrfs_add_to_fsid() to track the device path Goffredo Baroncelli
@ 2014-12-15 20:02 ` Goffredo Baroncelli
  2014-12-15 20:02 ` [PATCH 6/7] Print the summary Goffredo Baroncelli
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goffredo Baroncelli

The function make_btrfs() has as argument the fsid of the filesystem.
If this fsid is empty or null make_btrfs() generates a new fsid. However
If the buffer is valid (but the string is empty) the generated fsid is
copied back to the caller.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 utils.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/utils.c b/utils.c
index 3f50e4d..15127db 100644
--- a/utils.c
+++ b/utils.c
@@ -203,7 +203,7 @@ int make_btrfs(int fd, const char *device, const char *label, char *fs_uuid,
 	memset(&super, 0, sizeof(super));
 
 	num_bytes = (num_bytes / sectorsize) * sectorsize;
-	if (fs_uuid) {
+	if (fs_uuid && *fs_uuid) {
 		if (uuid_parse(fs_uuid, super.fsid) != 0) {
 			fprintf(stderr, "could not parse UUID: %s\n", fs_uuid);
 			ret = -EINVAL;
@@ -216,6 +216,11 @@ int make_btrfs(int fd, const char *device, const char *label, char *fs_uuid,
 		}
 	} else {
 		uuid_generate(super.fsid);
+		/* 
+		 * if the fs_uuid is a valid pointer, return the generated uuid
+		 */
+		if (fs_uuid)
+			uuid_unparse(super.fsid, fs_uuid);
 	}
 	uuid_generate(super.dev_item.uuid);
 	uuid_generate(chunk_tree_uuid);
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/7] Print the summary
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
                   ` (4 preceding siblings ...)
  2014-12-15 20:02 ` [PATCH 5/7] Return the fsid from make_btrfs() Goffredo Baroncelli
@ 2014-12-15 20:02 ` Goffredo Baroncelli
  2014-12-16  1:58   ` Duncan
  2014-12-16  3:27   ` Satoru Takeuchi
  2014-12-15 20:03 ` [PATCH 7/7] Add -v and -o switches Goffredo Baroncelli
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goffredo Baroncelli

This patch print the summary of the filesystem after the creation.
The main fileds printed are:
- devices list with their uuid, devid, path and size
- raid profile (dup,single,raid0...)
- leafsize/nodesize/sectorsize
- filesystem features (raid56, extref, mixed-bg)

If the '-v' switched is passed, the output is more verbose; if the '-q'
switched is passed, only the errors are printed.


Below an example:

# mkfs.btrfs -L btrfs-test -f -m raid5 -d raid5 /dev/vd[b-k]"
BTRFS filesystem summary:
  Label:		btrfs-test
  UUID:			1073cb19-b675-423d-9aba-caad7f1508a8

  Node size:		16384
  Leaf size:		16384
  Sector size:		4096
  Initial chunks:
    Data:		9.01GiB
    Metadata:		3.61GiB
    System:		18.06MiB
  Metadata profile:	RAID5
  Data profile:		RAID5
  Mixed mode:		NO
  SSD detected:		NO
  Features:		extref, raid56
  Number of devices:	10
    UUID                                  ID    SIZE    PATH
    ------------------------------------  --  --------- -----------
    62121322-5666-4ecf-bc8e-c9b3d9f60db9   1   50.00GiB /dev/vdb
    6158cb13-3ae8-42b6-8603-660f1e5c8a7a   2   50.00GiB /dev/vdc
    b49516db-ddf5-4f54-8831-a4babc79e901   3   50.00GiB /dev/vdd
    00b03d81-7d29-4894-8050-9dd205f97c41   4   50.00GiB /dev/vde
    f119a2ec-5ef0-436c-805e-c1b0612b05ca   5   50.00GiB /dev/vdf
    adee4f58-e094-4bd4-8c56-941527524f8d   6   50.00GiB /dev/vdg
    a8299171-2024-4057-ba56-1f83bf6d7e2e   7   50.00GiB /dev/vdh
    b694e275-e454-4dbd-beb0-e33c388cffa2   8    2.00GiB /dev/vdi
    7cbe04b5-36cd-4ea7-be82-206d5487914e   9    2.00GiB /dev/vdj
    7c320654-675e-456b-ac23-cfb148b8ea57  10    2.00GiB /dev/vdk

  Total disks size:                           356.01GiB


Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 mkfs.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 142 insertions(+), 28 deletions(-)

diff --git a/mkfs.c b/mkfs.c
index 26f8041..e956903 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -26,6 +26,7 @@
 #include "ioctl.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/dir.h>
@@ -57,7 +58,16 @@ struct directory_name_entry {
 	struct list_head list;
 };
 
-static int make_root_dir(struct btrfs_root *root, int mixed)
+struct block_group_allocation {
+	u64 data;
+	u64 metadata;
+	u64 mixed;
+	u64 system;
+};
+
+
+static int make_root_dir(struct btrfs_root *root, int mixed,
+				struct block_group_allocation *allocation)
 {
 	struct btrfs_trans_handle *trans;
 	struct btrfs_key location;
@@ -74,6 +84,7 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
 				     BTRFS_BLOCK_GROUP_SYSTEM,
 				     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
 				     0, BTRFS_MKFS_SYSTEM_GROUP_SIZE);
+	allocation->system += BTRFS_MKFS_SYSTEM_GROUP_SIZE;
 	BUG_ON(ret);
 
 	if (mixed) {
@@ -92,8 +103,8 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
 					     BTRFS_BLOCK_GROUP_DATA,
 					     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
 					     chunk_start, chunk_size);
+		allocation->mixed += chunk_size;
 		BUG_ON(ret);
-		printf("Created a data/metadata chunk of size %llu\n", chunk_size);
 	} else {
 		ret = btrfs_alloc_chunk(trans, root->fs_info->extent_root,
 					&chunk_start, &chunk_size,
@@ -107,6 +118,7 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
 					     BTRFS_BLOCK_GROUP_METADATA,
 					     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
 					     chunk_start, chunk_size);
+		allocation->metadata += chunk_size;
 		BUG_ON(ret);
 	}
 
@@ -128,6 +140,7 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
 					     BTRFS_BLOCK_GROUP_DATA,
 					     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
 					     chunk_start, chunk_size);
+		allocation->data += chunk_size;
 		BUG_ON(ret);
 	}
 
@@ -187,7 +200,9 @@ static void recow_roots(struct btrfs_trans_handle *trans,
 }
 
 static int create_one_raid_group(struct btrfs_trans_handle *trans,
-			      struct btrfs_root *root, u64 type)
+			      struct btrfs_root *root, u64 type,
+			      struct block_group_allocation *allocation)
+
 {
 	u64 chunk_start;
 	u64 chunk_size;
@@ -203,6 +218,18 @@ static int create_one_raid_group(struct btrfs_trans_handle *trans,
 	ret = btrfs_make_block_group(trans, root->fs_info->extent_root, 0,
 				     type, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
 				     chunk_start, chunk_size);
+	if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == BTRFS_BLOCK_GROUP_DATA)
+		allocation->data += chunk_size;
+	else if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == BTRFS_BLOCK_GROUP_METADATA)
+		allocation->metadata += chunk_size;
+	else if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == BTRFS_BLOCK_GROUP_SYSTEM)
+		allocation->system += chunk_size;
+	else if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) ==
+			(BTRFS_BLOCK_GROUP_METADATA|BTRFS_BLOCK_GROUP_DATA))
+		allocation->mixed += chunk_size;
+	else
+		BUG_ON(1);
+
 	BUG_ON(ret);
 	return ret;
 }
@@ -210,7 +237,8 @@ static int create_one_raid_group(struct btrfs_trans_handle *trans,
 static int create_raid_groups(struct btrfs_trans_handle *trans,
 			      struct btrfs_root *root, u64 data_profile,
 			      int data_profile_opt, u64 metadata_profile,
-			      int mixed)
+			      int mixed,
+			      struct block_group_allocation *allocation)
 {
 	u64 num_devices = btrfs_super_num_devices(root->fs_info->super_copy);
 	int ret;
@@ -220,21 +248,21 @@ static int create_raid_groups(struct btrfs_trans_handle *trans,
 
 		ret = create_one_raid_group(trans, root,
 					    BTRFS_BLOCK_GROUP_SYSTEM |
-					    metadata_profile);
+					    metadata_profile, allocation);
 		BUG_ON(ret);
 
 		if (mixed)
 			meta_flags |= BTRFS_BLOCK_GROUP_DATA;
 
 		ret = create_one_raid_group(trans, root, meta_flags |
-					    metadata_profile);
+					    metadata_profile, allocation);
 		BUG_ON(ret);
 
 	}
 	if (!mixed && num_devices > 1 && data_profile) {
 		ret = create_one_raid_group(trans, root,
 					    BTRFS_BLOCK_GROUP_DATA |
-					    data_profile);
+					    data_profile, allocation);
 		BUG_ON(ret);
 	}
 	recow_roots(trans, root);
@@ -920,7 +948,8 @@ static int open_target(char *output_name)
 
 static int create_chunks(struct btrfs_trans_handle *trans,
 			 struct btrfs_root *root, u64 num_of_meta_chunks,
-			 u64 size_of_data)
+			 u64 size_of_data,
+			 struct block_group_allocation *allocation)
 {
 	u64 chunk_start;
 	u64 chunk_size;
@@ -937,6 +966,7 @@ static int create_chunks(struct btrfs_trans_handle *trans,
 		ret = btrfs_make_block_group(trans, root->fs_info->extent_root, 0,
 					     meta_type, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
 					     chunk_start, chunk_size);
+		allocation->metadata += chunk_size;
 		BUG_ON(ret);
 		set_extent_dirty(&root->fs_info->free_space_cache,
 				 chunk_start, chunk_start + chunk_size - 1, 0);
@@ -951,6 +981,7 @@ static int create_chunks(struct btrfs_trans_handle *trans,
 	ret = btrfs_make_block_group(trans, root->fs_info->extent_root, 0,
 				     data_type, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
 				     chunk_start, size_of_data);
+	allocation->data += size_of_data;
 	BUG_ON(ret);
 	set_extent_dirty(&root->fs_info->free_space_cache,
 			 chunk_start, chunk_start + size_of_data - 1, 0);
@@ -1221,6 +1252,21 @@ static void process_fs_features(u64 flags)
 	}
 }
 
+static void print_fs_features(u64 flags)
+{
+	int i;
+	int first = 1;
+
+	for (i = 0; i < ARRAY_SIZE(mkfs_features); i++) {
+		if (flags & mkfs_features[i].flag) {
+			if (!first)
+				printf(", %s",mkfs_features[i].name);
+			else
+				printf("%s",mkfs_features[i].name);
+			first=0;
+		}
+	}
+}
 
 /*
  * Return NULL if all features were parsed fine, otherwise return the name of
@@ -1241,13 +1287,43 @@ static char* parse_fs_features(char *namelist, u64 *flags)
 	return NULL;
 }
 
+static void list_all_devices(struct btrfs_root *root)
+{
+	struct btrfs_fs_devices *fs_devices;
+	struct btrfs_device *device;
+	int number_of_disks = 0;
+	u64 total_block_count = 0;
+
+	fs_devices = root->fs_info->fs_devices;
+
+	list_for_each_entry(device, &fs_devices->devices, dev_list)
+		number_of_disks++;
+
+	printf("  Number of devices:\t%d\n", number_of_disks);
+	printf("    UUID                                  ID    SIZE    PATH\n");
+	printf("    ------------------------------------  --  --------- -----------\n");
+	list_for_each_entry_reverse(device, &fs_devices->devices, dev_list) {
+		char dev_uuid[BTRFS_UUID_UNPARSED_SIZE];
+
+		uuid_unparse(device->uuid, dev_uuid);
+		printf("    %s %3llu %10s %s\n",
+			dev_uuid, device->devid,
+			pretty_size(device->total_bytes),
+			device->name);
+		total_block_count += device->total_bytes;
+	}
+
+	printf("\n");
+	printf("  Total disks size:                          %10s\n",
+		pretty_size(total_block_count));
+}
+
 int main(int ac, char **av)
 {
 	char *file;
 	struct btrfs_root *root;
 	struct btrfs_trans_handle *trans;
 	char *label = NULL;
-	char *first_file;
 	u64 block_count = 0;
 	u64 dev_block_count = 0;
 	u64 blocks[7];
@@ -1281,12 +1357,13 @@ int main(int ac, char **av)
 	int dev_cnt = 0;
 	int saved_optind;
 	char estr[100];
-	char *fs_uuid = NULL;
+	char fs_uuid[BTRFS_UUID_UNPARSED_SIZE] = { 0 };
 	u64 features = DEFAULT_MKFS_FEATURES;
+	struct block_group_allocation allocation = { 0 };
 
 	while(1) {
 		int c;
-		c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:U:VMK",
+		c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:U:VMKqv",
 				long_options, &option_index);
 		if (c < 0)
 			break;
@@ -1356,7 +1433,8 @@ int main(int ac, char **av)
 				source_dir_set = 1;
 				break;
 			case 'U':
-				fs_uuid = optarg;
+				strncpy(fs_uuid,optarg,
+					BTRFS_UUID_UNPARSED_SIZE - 1);
 				break;
 			case 'K':
 				discard = 0;
@@ -1387,7 +1465,7 @@ int main(int ac, char **av)
 		exit(1);
 	}
 
-	if (fs_uuid) {
+	if (*fs_uuid) {
 		uuid_t dummy_uuid;
 
 		if (uuid_parse(fs_uuid, dummy_uuid) != 0) {
@@ -1500,9 +1578,11 @@ int main(int ac, char **av)
 		exit(1);
 	}
 
-	/* if we are here that means all devs are good to btrfsify */
-	printf("%s\n", BTRFS_BUILD_VERSION);
-	printf("See http://btrfs.wiki.kernel.org for more information.\n\n");
+	if (verbose) {
+		/* if we are here that means all devs are good to btrfsify */
+		printf("%s\n", BTRFS_BUILD_VERSION);
+		printf("See http://btrfs.wiki.kernel.org for more information.\n\n");
+	}
 
 	dev_cnt--;
 
@@ -1518,7 +1598,6 @@ int main(int ac, char **av)
 				strerror(errno));
 			exit(1);
 		}
-		first_file = file;
 		ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count,
 					   block_count, &mixed, discard);
 		if (ret) {
@@ -1536,7 +1615,6 @@ int main(int ac, char **av)
 			exit(1);
 		}
 
-		first_file = file;
 		source_dir_size = size_sourcedir(source_dir, sectorsize,
 					     &num_of_meta_chunks, &size_of_data);
 		if(block_count < source_dir_size)
@@ -1574,7 +1652,8 @@ int main(int ac, char **av)
 		features |= BTRFS_FEATURE_INCOMPAT_RAID56;
 	}
 
-	process_fs_features(features);
+	if (verbose)
+		process_fs_features(features);
 
 	ret = make_btrfs(fd, file, label, fs_uuid, blocks, dev_block_count,
 			 nodesize, leafsize,
@@ -1592,7 +1671,7 @@ int main(int ac, char **av)
 	}
 	root->fs_info->alloc_start = alloc_start;
 
-	ret = make_root_dir(root, mixed);
+	ret = make_root_dir(root, mixed, &allocation);
 	if (ret) {
 		fprintf(stderr, "failed to setup the root directory\n");
 		exit(1);
@@ -1605,6 +1684,7 @@ int main(int ac, char **av)
 	if (dev_cnt == 0)
 		goto raid_groups;
 
+
 	while (dev_cnt-- > 0) {
 		int old_mixed = mixed;
 
@@ -1631,6 +1711,7 @@ int main(int ac, char **av)
 		}
 		ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count,
 					   block_count, &mixed, discard);
+
 		if (ret) {
 			close(fd);
 			exit(1);
@@ -1638,7 +1719,8 @@ int main(int ac, char **av)
 		mixed = old_mixed;
 
 		ret = btrfs_add_to_fsid(trans, root, fd, file, dev_block_count,
-					sectorsize, sectorsize, sectorsize);
+					sectorsize, sectorsize, sectorsize,
+					verbose);
 		BUG_ON(ret);
 		btrfs_register_one_device(file);
 	}
@@ -1647,24 +1729,20 @@ raid_groups:
 	if (!source_dir_set) {
 		ret = create_raid_groups(trans, root, data_profile,
 				 data_profile_opt, metadata_profile,
-				 mixed);
+				 mixed, &allocation);
 		BUG_ON(ret);
 	}
 
 	ret = create_data_reloc_tree(trans, root);
 	BUG_ON(ret);
 
-	printf("fs created label %s on %s\n\tnodesize %u leafsize %u "
-	    "sectorsize %u size %s\n",
-	    label, first_file, nodesize, leafsize, sectorsize,
-	    pretty_size(btrfs_super_total_bytes(root->fs_info->super_copy)));
-
 	btrfs_commit_transaction(trans, root);
 
 	if (source_dir_set) {
 		trans = btrfs_start_transaction(root, 1);
 		ret = create_chunks(trans, root,
-				    num_of_meta_chunks, size_of_data);
+				    num_of_meta_chunks, size_of_data,
+				    &allocation);
 		BUG_ON(ret);
 		btrfs_commit_transaction(trans, root);
 
@@ -1672,6 +1750,42 @@ raid_groups:
 		BUG_ON(ret);
 	}
 
+	if (!quiet) {
+		printf("BTRFS filesystem summary:\n");
+		printf("  Label:\t\t%s\n", label);
+		printf("  UUID:\t\t\t%s\n", fs_uuid);
+		printf("\n");
+
+		printf("  Node size:\t\t%u\n", nodesize);
+		printf("  Leaf size:\t\t%u\n", leafsize);
+		printf("  Sector size:\t\t%u\n", sectorsize);
+		printf("  Initial chunks:\n");
+		if (allocation.data)
+			printf("    Data:\t\t%s\n",
+				pretty_size(allocation.data));
+		if (allocation.metadata)
+			printf("    Metadata:\t\t%s\n",
+				pretty_size(allocation.metadata));
+		if (allocation.mixed)
+			printf("    Data+Metadata:\t%s\n",
+				pretty_size(allocation.mixed));
+		printf("    System:\t\t%s\n",
+			pretty_size(allocation.system));
+		printf("  Metadata profile:\t%s\n",
+			group_profile_str(metadata_profile));
+		printf("  Data profile:\t\t%s\n",
+			group_profile_str(data_profile));
+		printf("  Mixed mode:\t\t%s\n", mixed ? "YES" : "NO");
+		printf("  SSD detected:\t\t%s\n", ssd ? "YES" : "NO");
+		printf("  Features:\t\t");
+		print_fs_features(features);
+		printf("\n");
+
+		list_all_devices(root);
+
+	}
+
+
 	ret = close_ctree(root);
 	BUG_ON(ret);
 	free(label);
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 7/7] Add -v and -o switches
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
                   ` (5 preceding siblings ...)
  2014-12-15 20:02 ` [PATCH 6/7] Print the summary Goffredo Baroncelli
@ 2014-12-15 20:03 ` Goffredo Baroncelli
  2014-12-16  3:23 ` [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Satoru Takeuchi
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-15 20:03 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goffredo Baroncelli

Add -v and -o switches to the mkfs.btrfs man page.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 Documentation/mkfs.btrfs.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/mkfs.btrfs.txt b/Documentation/mkfs.btrfs.txt
index ba7e42b..8ecb1a6 100644
--- a/Documentation/mkfs.btrfs.txt
+++ b/Documentation/mkfs.btrfs.txt
@@ -17,13 +17,16 @@ $$[-l|--leafsize <leafsize>]$$
 $$[-L|--label <label>]$$
 $$[-m|--metadata <metadata profile>]$$
 $$[-M|--mixed]$$
+$$[-q|--quiet]$$
 $$[-s|--sectorsize <sectorsize>]$$
 $$[-r|--rootdir <rootdir>]$$
 $$[-K|--nodiscard]$$
 $$[-O|--features <feature1>[,<feature2>...]]$$
+$$[-q|--quiet]$$
 $$[-U|--uuid <UUID>]$$
 $$[-h]$$
 $$[-V|--version]$$
+$$[-v|--verbose]$$
 $$<device> [<device>...]$$
 
 DESCRIPTION
@@ -120,6 +123,12 @@ the system.
 -V|--version::
 Print the *mkfs.btrfs* version and exit.
 
+-v|--verbose::
+Increase the verbosity of the command.
+
+-q|--quiet::
+Print only the errors.
+
 -h::
 Print help.
 
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] Print the summary
  2014-12-15 20:02 ` [PATCH 6/7] Print the summary Goffredo Baroncelli
@ 2014-12-16  1:58   ` Duncan
  2014-12-16  3:47     ` Robert White
  2014-12-17 18:59     ` [PATCH 6/7] Print the summary Goffredo Baroncelli
  2014-12-16  3:27   ` Satoru Takeuchi
  1 sibling, 2 replies; 22+ messages in thread
From: Duncan @ 2014-12-16  1:58 UTC (permalink / raw)
  To: linux-btrfs

Goffredo Baroncelli posted on Mon, 15 Dec 2014 21:02:59 +0100 as
excerpted:

> +	printf("  Total disks size:                          %10s\n",
> +		pretty_size(total_block_count));

I really like this patch series. Makes mkfs.btrfs much nicer to use. =:^)

I'm not a dev and won't attempt a technical review, but three very minor 
and quick nits:

* Please s/disk/device/, here and possibly elsewhere.  I know I'm not the 
only one who is trying to make the switch in my own usage, as it looks a 
bit foolish (and/or marks the user as an old fogey who's likely to start 
lecturing about how a GiB isn't "small", as I'm known to do at times! 
=:^) already, as it's only going to be more so over time.

* patch title typo and omission, patch 7:  There's a good chance you 
already caught it, but just in case, for the next version, s/-o/-q/, and 
please mention it's /documentation/ that's patched here (patch 1 adds the 
switches to the code).

* Also in patch 7, first chunk, -q|--quiet is added twice...

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
                   ` (6 preceding siblings ...)
  2014-12-15 20:03 ` [PATCH 7/7] Add -v and -o switches Goffredo Baroncelli
@ 2014-12-16  3:23 ` Satoru Takeuchi
  2014-12-17 19:49   ` Goffredo Baroncelli
  2014-12-17 14:29 ` David Sterba
  2014-12-17 15:08 ` Holger Hoffstätte
  9 siblings, 1 reply; 22+ messages in thread
From: Satoru Takeuchi @ 2014-12-16  3:23 UTC (permalink / raw)
  To: Goffredo Baroncelli, linux-btrfs

Hi Goffredo,

(2014/12/16 5:02), Goffredo Baroncelli wrote:
> 
> 
> Hi All,
> 
> enclosed a patches set to improve the output of mkfs.btrfs command.

The idea looks nice to me. I have some comments about
new output.

Thanks,
Satoru

> 
> Currently I find the output of mkfs.btrfs command quite confusing:
> 
> # mkfs.btrfs -f -M -d raid5 -m raid5 /dev/vd[b-k]
> 
> Btrfs v3.17
> See http://btrfs.wiki.kernel.org for more information.
> 
> Turning ON incompat feature 'mixed-bg': mixed data and metadata block groups
> Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
> Turning ON incompat feature 'raid56': raid56 extended format
> Created a data/metadata chunk of size 8388608
> adding device /dev/vdc id 2
> adding device /dev/vdd id 3
> adding device /dev/vde id 4
> adding device /dev/vdf id 5
> adding device /dev/vdg id 6
> adding device /dev/vdh id 7
> adding device /dev/vdi id 8
> adding device /dev/vdj id 9
> adding device /dev/vdk id 10
> fs created label (null) on /dev/vdb
> 	nodesize 4096 leafsize 4096 sectorsize 4096 size 356.01GiB
> 
> After my patches the output becomes:
> 
> # mkfs.btrfs -f -d raid5 -m raid5 /dev/vd[b-k]
> BTRFS filesystem summary:
>    Label:		btrfs-test
>    UUID:			1073cb19-b675-423d-9aba-caad7f1508a8
> 
>    Node size:		16384
>    Leaf size:		16384
>    Sector size:		4096
>    Initial chunks:
>      Data:		9.01GiB
>      Metadata:		3.61GiB
>      System:		18.06MiB
>    Metadata profile:	RAID5
>    Data profile:		RAID5
>    Mixed mode:		NO
>    SSD detected:		NO
>    Features:		extref, raid56

It removes "Incompat" from original message. I consider
"Backward Incompatible Feature" is better. I consider,
the word, "incompatible", is very important for users.

In addition, original version (without your patch) has
the message turning on mixed-bg. However, the "Features"
line of new version doesn't show mixed-bg. Is it a bug
or am I missing something?

Thanks,
Satoru

>    Number of devices:	10
>      UUID                                  ID    SIZE    PATH
>      ------------------------------------  --  --------- -----------
>      62121322-5666-4ecf-bc8e-c9b3d9f60db9   1   50.00GiB /dev/vdb
>      6158cb13-3ae8-42b6-8603-660f1e5c8a7a   2   50.00GiB /dev/vdc
>      b49516db-ddf5-4f54-8831-a4babc79e901   3   50.00GiB /dev/vdd
>      00b03d81-7d29-4894-8050-9dd205f97c41   4   50.00GiB /dev/vde
>      f119a2ec-5ef0-436c-805e-c1b0612b05ca   5   50.00GiB /dev/vdf
>      adee4f58-e094-4bd4-8c56-941527524f8d   6   50.00GiB /dev/vdg
>      a8299171-2024-4057-ba56-1f83bf6d7e2e   7   50.00GiB /dev/vdh
>      b694e275-e454-4dbd-beb0-e33c388cffa2   8    2.00GiB /dev/vdi
>      7cbe04b5-36cd-4ea7-be82-206d5487914e   9    2.00GiB /dev/vdj
>      7c320654-675e-456b-ac23-cfb148b8ea57  10    2.00GiB /dev/vdk
> 
>    Total disks size:                           356.01GiB
> 
> 
> Each information is in its own row. The disks are listed with more
> information (disk uuid, id, size of each disk...)
> Nodesize, Leafsize, Sectorsize are separated by the filesystem size.
> 
> The metadata/data profile are displayed (before this information was missed).
> Also the size of the data/metadata/system chunk are displayed.
> 
> This is an RFC to collect suggestions.
> 
> 
> These changes are also available via github
> https://github.com/kreijack/btrfs-progs/commit/44fc80342b9c238f41b803cb0b9b4efe9b66d56f
> 
> 
> BR
> G.Baroncelli
> 
> 
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] Print the summary
  2014-12-15 20:02 ` [PATCH 6/7] Print the summary Goffredo Baroncelli
  2014-12-16  1:58   ` Duncan
@ 2014-12-16  3:27   ` Satoru Takeuchi
  1 sibling, 0 replies; 22+ messages in thread
From: Satoru Takeuchi @ 2014-12-16  3:27 UTC (permalink / raw)
  To: Goffredo Baroncelli, linux-btrfs; +Cc: Goffredo Baroncelli

(2014/12/16 5:02), Goffredo Baroncelli wrote:
> This patch print the summary of the filesystem after the creation.
> The main fileds printed are:
> - devices list with their uuid, devid, path and size
> - raid profile (dup,single,raid0...)
> - leafsize/nodesize/sectorsize
> - filesystem features (raid56, extref, mixed-bg)
> 
> If the '-v' switched is passed, the output is more verbose; if the '-q'
> switched is passed, only the errors are printed.




> 
> 
> Below an example:
> 
> # mkfs.btrfs -L btrfs-test -f -m raid5 -d raid5 /dev/vd[b-k]"
> BTRFS filesystem summary:
>    Label:		btrfs-test
>    UUID:			1073cb19-b675-423d-9aba-caad7f1508a8
> 
>    Node size:		16384
>    Leaf size:		16384
>    Sector size:		4096
>    Initial chunks:
>      Data:		9.01GiB
>      Metadata:		3.61GiB
>      System:		18.06MiB
>    Metadata profile:	RAID5
>    Data profile:		RAID5
>    Mixed mode:		NO
>    SSD detected:		NO
>    Features:		extref, raid56
>    Number of devices:	10
>      UUID                                  ID    SIZE    PATH
>      ------------------------------------  --  --------- -----------
>      62121322-5666-4ecf-bc8e-c9b3d9f60db9   1   50.00GiB /dev/vdb
>      6158cb13-3ae8-42b6-8603-660f1e5c8a7a   2   50.00GiB /dev/vdc
>      b49516db-ddf5-4f54-8831-a4babc79e901   3   50.00GiB /dev/vdd
>      00b03d81-7d29-4894-8050-9dd205f97c41   4   50.00GiB /dev/vde
>      f119a2ec-5ef0-436c-805e-c1b0612b05ca   5   50.00GiB /dev/vdf
>      adee4f58-e094-4bd4-8c56-941527524f8d   6   50.00GiB /dev/vdg
>      a8299171-2024-4057-ba56-1f83bf6d7e2e   7   50.00GiB /dev/vdh
>      b694e275-e454-4dbd-beb0-e33c388cffa2   8    2.00GiB /dev/vdi
>      7cbe04b5-36cd-4ea7-be82-206d5487914e   9    2.00GiB /dev/vdj
>      7c320654-675e-456b-ac23-cfb148b8ea57  10    2.00GiB /dev/vdk
> 
>    Total disks size:                           356.01GiB
> 
> 
> Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
> ---
>   mkfs.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
>   1 file changed, 142 insertions(+), 28 deletions(-)
> 
> diff --git a/mkfs.c b/mkfs.c
> index 26f8041..e956903 100644
> --- a/mkfs.c
> +++ b/mkfs.c
> @@ -26,6 +26,7 @@
>   #include "ioctl.h"
>   #include <stdio.h>
>   #include <stdlib.h>
> +#include <string.h>
>   #include <sys/types.h>
>   #include <sys/stat.h>
>   #include <sys/dir.h>
> @@ -57,7 +58,16 @@ struct directory_name_entry {
>   	struct list_head list;
>   };
>   
> -static int make_root_dir(struct btrfs_root *root, int mixed)
> +struct block_group_allocation {
> +	u64 data;
> +	u64 metadata;
> +	u64 mixed;
> +	u64 system;
> +};
> +
> +
> +static int make_root_dir(struct btrfs_root *root, int mixed,
> +				struct block_group_allocation *allocation)
>   {
>   	struct btrfs_trans_handle *trans;
>   	struct btrfs_key location;
> @@ -74,6 +84,7 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
>   				     BTRFS_BLOCK_GROUP_SYSTEM,
>   				     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
>   				     0, BTRFS_MKFS_SYSTEM_GROUP_SIZE);
> +	allocation->system += BTRFS_MKFS_SYSTEM_GROUP_SIZE;
>   	BUG_ON(ret);
>   
>   	if (mixed) {
> @@ -92,8 +103,8 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
>   					     BTRFS_BLOCK_GROUP_DATA,
>   					     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
>   					     chunk_start, chunk_size);
> +		allocation->mixed += chunk_size;
>   		BUG_ON(ret);
> -		printf("Created a data/metadata chunk of size %llu\n", chunk_size);
>   	} else {
>   		ret = btrfs_alloc_chunk(trans, root->fs_info->extent_root,
>   					&chunk_start, &chunk_size,
> @@ -107,6 +118,7 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
>   					     BTRFS_BLOCK_GROUP_METADATA,
>   					     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
>   					     chunk_start, chunk_size);
> +		allocation->metadata += chunk_size;
>   		BUG_ON(ret);
>   	}
>   
> @@ -128,6 +140,7 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
>   					     BTRFS_BLOCK_GROUP_DATA,
>   					     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
>   					     chunk_start, chunk_size);
> +		allocation->data += chunk_size;
>   		BUG_ON(ret);
>   	}
>   
> @@ -187,7 +200,9 @@ static void recow_roots(struct btrfs_trans_handle *trans,
>   }
>   
>   static int create_one_raid_group(struct btrfs_trans_handle *trans,
> -			      struct btrfs_root *root, u64 type)
> +			      struct btrfs_root *root, u64 type,
> +			      struct block_group_allocation *allocation)
> +
>   {
>   	u64 chunk_start;
>   	u64 chunk_size;
> @@ -203,6 +218,18 @@ static int create_one_raid_group(struct btrfs_trans_handle *trans,
>   	ret = btrfs_make_block_group(trans, root->fs_info->extent_root, 0,
>   				     type, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
>   				     chunk_start, chunk_size);
> +	if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == BTRFS_BLOCK_GROUP_DATA)
> +		allocation->data += chunk_size;
> +	else if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == BTRFS_BLOCK_GROUP_METADATA)
> +		allocation->metadata += chunk_size;
> +	else if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == BTRFS_BLOCK_GROUP_SYSTEM)
> +		allocation->system += chunk_size;
> +	else if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) ==
> +			(BTRFS_BLOCK_GROUP_METADATA|BTRFS_BLOCK_GROUP_DATA))
> +		allocation->mixed += chunk_size;
> +	else
> +		BUG_ON(1);
> +
>   	BUG_ON(ret);
>   	return ret;
>   }
> @@ -210,7 +237,8 @@ static int create_one_raid_group(struct btrfs_trans_handle *trans,
>   static int create_raid_groups(struct btrfs_trans_handle *trans,
>   			      struct btrfs_root *root, u64 data_profile,
>   			      int data_profile_opt, u64 metadata_profile,
> -			      int mixed)
> +			      int mixed,
> +			      struct block_group_allocation *allocation)
>   {
>   	u64 num_devices = btrfs_super_num_devices(root->fs_info->super_copy);
>   	int ret;
> @@ -220,21 +248,21 @@ static int create_raid_groups(struct btrfs_trans_handle *trans,
>   
>   		ret = create_one_raid_group(trans, root,
>   					    BTRFS_BLOCK_GROUP_SYSTEM |
> -					    metadata_profile);
> +					    metadata_profile, allocation);
>   		BUG_ON(ret);
>   
>   		if (mixed)
>   			meta_flags |= BTRFS_BLOCK_GROUP_DATA;
>   
>   		ret = create_one_raid_group(trans, root, meta_flags |
> -					    metadata_profile);
> +					    metadata_profile, allocation);
>   		BUG_ON(ret);
>   
>   	}
>   	if (!mixed && num_devices > 1 && data_profile) {
>   		ret = create_one_raid_group(trans, root,
>   					    BTRFS_BLOCK_GROUP_DATA |
> -					    data_profile);
> +					    data_profile, allocation);
>   		BUG_ON(ret);
>   	}
>   	recow_roots(trans, root);
> @@ -920,7 +948,8 @@ static int open_target(char *output_name)
>   
>   static int create_chunks(struct btrfs_trans_handle *trans,
>   			 struct btrfs_root *root, u64 num_of_meta_chunks,
> -			 u64 size_of_data)
> +			 u64 size_of_data,
> +			 struct block_group_allocation *allocation)
>   {
>   	u64 chunk_start;
>   	u64 chunk_size;
> @@ -937,6 +966,7 @@ static int create_chunks(struct btrfs_trans_handle *trans,
>   		ret = btrfs_make_block_group(trans, root->fs_info->extent_root, 0,
>   					     meta_type, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
>   					     chunk_start, chunk_size);
> +		allocation->metadata += chunk_size;
>   		BUG_ON(ret);
>   		set_extent_dirty(&root->fs_info->free_space_cache,
>   				 chunk_start, chunk_start + chunk_size - 1, 0);
> @@ -951,6 +981,7 @@ static int create_chunks(struct btrfs_trans_handle *trans,
>   	ret = btrfs_make_block_group(trans, root->fs_info->extent_root, 0,
>   				     data_type, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
>   				     chunk_start, size_of_data);
> +	allocation->data += size_of_data;
>   	BUG_ON(ret);
>   	set_extent_dirty(&root->fs_info->free_space_cache,
>   			 chunk_start, chunk_start + size_of_data - 1, 0);
> @@ -1221,6 +1252,21 @@ static void process_fs_features(u64 flags)
>   	}
>   }
>   
> +static void print_fs_features(u64 flags)
> +{
> +	int i;
> +	int first = 1;
> +
> +	for (i = 0; i < ARRAY_SIZE(mkfs_features); i++) {
> +		if (flags & mkfs_features[i].flag) {
> +			if (!first)
> +				printf(", %s",mkfs_features[i].name);
> +			else
> +				printf("%s",mkfs_features[i].name);
> +			first=0;

A trivial comment.

if (first) {
	printf(...
	first = 0;
} else {
	printf(...
}

is better.

Thanks,
Satoru

> +		}
> +	}
> +}
>   
>   /*
>    * Return NULL if all features were parsed fine, otherwise return the name of
> @@ -1241,13 +1287,43 @@ static char* parse_fs_features(char *namelist, u64 *flags)
>   	return NULL;
>   }
>   
> +static void list_all_devices(struct btrfs_root *root)
> +{
> +	struct btrfs_fs_devices *fs_devices;
> +	struct btrfs_device *device;
> +	int number_of_disks = 0;
> +	u64 total_block_count = 0;
> +
> +	fs_devices = root->fs_info->fs_devices;
> +
> +	list_for_each_entry(device, &fs_devices->devices, dev_list)
> +		number_of_disks++;
> +
> +	printf("  Number of devices:\t%d\n", number_of_disks);
> +	printf("    UUID                                  ID    SIZE    PATH\n");
> +	printf("    ------------------------------------  --  --------- -----------\n");
> +	list_for_each_entry_reverse(device, &fs_devices->devices, dev_list) {
> +		char dev_uuid[BTRFS_UUID_UNPARSED_SIZE];
> +
> +		uuid_unparse(device->uuid, dev_uuid);
> +		printf("    %s %3llu %10s %s\n",
> +			dev_uuid, device->devid,
> +			pretty_size(device->total_bytes),
> +			device->name);
> +		total_block_count += device->total_bytes;
> +	}
> +
> +	printf("\n");
> +	printf("  Total disks size:                          %10s\n",
> +		pretty_size(total_block_count));
> +}
> +
>   int main(int ac, char **av)
>   {
>   	char *file;
>   	struct btrfs_root *root;
>   	struct btrfs_trans_handle *trans;
>   	char *label = NULL;
> -	char *first_file;
>   	u64 block_count = 0;
>   	u64 dev_block_count = 0;
>   	u64 blocks[7];
> @@ -1281,12 +1357,13 @@ int main(int ac, char **av)
>   	int dev_cnt = 0;
>   	int saved_optind;
>   	char estr[100];
> -	char *fs_uuid = NULL;
> +	char fs_uuid[BTRFS_UUID_UNPARSED_SIZE] = { 0 };
>   	u64 features = DEFAULT_MKFS_FEATURES;
> +	struct block_group_allocation allocation = { 0 };
>   
>   	while(1) {
>   		int c;
> -		c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:U:VMK",
> +		c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:U:VMKqv",
>   				long_options, &option_index);
>   		if (c < 0)
>   			break;
> @@ -1356,7 +1433,8 @@ int main(int ac, char **av)
>   				source_dir_set = 1;
>   				break;
>   			case 'U':
> -				fs_uuid = optarg;
> +				strncpy(fs_uuid,optarg,
> +					BTRFS_UUID_UNPARSED_SIZE - 1);
>   				break;
>   			case 'K':
>   				discard = 0;
> @@ -1387,7 +1465,7 @@ int main(int ac, char **av)
>   		exit(1);
>   	}
>   
> -	if (fs_uuid) {
> +	if (*fs_uuid) {
>   		uuid_t dummy_uuid;
>   
>   		if (uuid_parse(fs_uuid, dummy_uuid) != 0) {
> @@ -1500,9 +1578,11 @@ int main(int ac, char **av)
>   		exit(1);
>   	}
>   
> -	/* if we are here that means all devs are good to btrfsify */
> -	printf("%s\n", BTRFS_BUILD_VERSION);
> -	printf("See http://btrfs.wiki.kernel.org for more information.\n\n");
> +	if (verbose) {
> +		/* if we are here that means all devs are good to btrfsify */
> +		printf("%s\n", BTRFS_BUILD_VERSION);
> +		printf("See http://btrfs.wiki.kernel.org for more information.\n\n");
> +	}
>   
>   	dev_cnt--;
>   
> @@ -1518,7 +1598,6 @@ int main(int ac, char **av)
>   				strerror(errno));
>   			exit(1);
>   		}
> -		first_file = file;
>   		ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count,
>   					   block_count, &mixed, discard);
>   		if (ret) {
> @@ -1536,7 +1615,6 @@ int main(int ac, char **av)
>   			exit(1);
>   		}
>   
> -		first_file = file;
>   		source_dir_size = size_sourcedir(source_dir, sectorsize,
>   					     &num_of_meta_chunks, &size_of_data);
>   		if(block_count < source_dir_size)
> @@ -1574,7 +1652,8 @@ int main(int ac, char **av)
>   		features |= BTRFS_FEATURE_INCOMPAT_RAID56;
>   	}
>   
> -	process_fs_features(features);
> +	if (verbose)
> +		process_fs_features(features);
>   
>   	ret = make_btrfs(fd, file, label, fs_uuid, blocks, dev_block_count,
>   			 nodesize, leafsize,
> @@ -1592,7 +1671,7 @@ int main(int ac, char **av)
>   	}
>   	root->fs_info->alloc_start = alloc_start;
>   
> -	ret = make_root_dir(root, mixed);
> +	ret = make_root_dir(root, mixed, &allocation);
>   	if (ret) {
>   		fprintf(stderr, "failed to setup the root directory\n");
>   		exit(1);
> @@ -1605,6 +1684,7 @@ int main(int ac, char **av)
>   	if (dev_cnt == 0)
>   		goto raid_groups;
>   
> +
>   	while (dev_cnt-- > 0) {
>   		int old_mixed = mixed;
>   
> @@ -1631,6 +1711,7 @@ int main(int ac, char **av)
>   		}
>   		ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count,
>   					   block_count, &mixed, discard);
> +
>   		if (ret) {
>   			close(fd);
>   			exit(1);
> @@ -1638,7 +1719,8 @@ int main(int ac, char **av)
>   		mixed = old_mixed;
>   
>   		ret = btrfs_add_to_fsid(trans, root, fd, file, dev_block_count,
> -					sectorsize, sectorsize, sectorsize);
> +					sectorsize, sectorsize, sectorsize,
> +					verbose);
>   		BUG_ON(ret);
>   		btrfs_register_one_device(file);
>   	}
> @@ -1647,24 +1729,20 @@ raid_groups:
>   	if (!source_dir_set) {
>   		ret = create_raid_groups(trans, root, data_profile,
>   				 data_profile_opt, metadata_profile,
> -				 mixed);
> +				 mixed, &allocation);
>   		BUG_ON(ret);
>   	}
>   
>   	ret = create_data_reloc_tree(trans, root);
>   	BUG_ON(ret);
>   
> -	printf("fs created label %s on %s\n\tnodesize %u leafsize %u "
> -	    "sectorsize %u size %s\n",
> -	    label, first_file, nodesize, leafsize, sectorsize,
> -	    pretty_size(btrfs_super_total_bytes(root->fs_info->super_copy)));
> -
>   	btrfs_commit_transaction(trans, root);
>   
>   	if (source_dir_set) {
>   		trans = btrfs_start_transaction(root, 1);
>   		ret = create_chunks(trans, root,
> -				    num_of_meta_chunks, size_of_data);
> +				    num_of_meta_chunks, size_of_data,
> +				    &allocation);
>   		BUG_ON(ret);
>   		btrfs_commit_transaction(trans, root);
>   
> @@ -1672,6 +1750,42 @@ raid_groups:
>   		BUG_ON(ret);
>   	}
>   
> +	if (!quiet) {
> +		printf("BTRFS filesystem summary:\n");
> +		printf("  Label:\t\t%s\n", label);
> +		printf("  UUID:\t\t\t%s\n", fs_uuid);
> +		printf("\n");
> +
> +		printf("  Node size:\t\t%u\n", nodesize);
> +		printf("  Leaf size:\t\t%u\n", leafsize);
> +		printf("  Sector size:\t\t%u\n", sectorsize);
> +		printf("  Initial chunks:\n");
> +		if (allocation.data)
> +			printf("    Data:\t\t%s\n",
> +				pretty_size(allocation.data));
> +		if (allocation.metadata)
> +			printf("    Metadata:\t\t%s\n",
> +				pretty_size(allocation.metadata));
> +		if (allocation.mixed)
> +			printf("    Data+Metadata:\t%s\n",
> +				pretty_size(allocation.mixed));
> +		printf("    System:\t\t%s\n",
> +			pretty_size(allocation.system));
> +		printf("  Metadata profile:\t%s\n",
> +			group_profile_str(metadata_profile));
> +		printf("  Data profile:\t\t%s\n",
> +			group_profile_str(data_profile));
> +		printf("  Mixed mode:\t\t%s\n", mixed ? "YES" : "NO");
> +		printf("  SSD detected:\t\t%s\n", ssd ? "YES" : "NO");
> +		printf("  Features:\t\t");
> +		print_fs_features(features);
> +		printf("\n");
> +
> +		list_all_devices(root);
> +
> +	}
> +
> +
>   	ret = close_ctree(root);
>   	BUG_ON(ret);
>   	free(label);
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] Print the summary
  2014-12-16  1:58   ` Duncan
@ 2014-12-16  3:47     ` Robert White
  2014-12-16  9:05       ` Hugo Mills
  2014-12-17 18:59     ` [PATCH 6/7] Print the summary Goffredo Baroncelli
  1 sibling, 1 reply; 22+ messages in thread
From: Robert White @ 2014-12-16  3:47 UTC (permalink / raw)
  To: Duncan, linux-btrfs

On 12/15/2014 05:58 PM, Duncan wrote:
> * Please s/disk/device/, here and possibly elsewhere.  I know I'm not the
> only one who is trying to make the switch in my own usage, as it looks a
> bit foolish (and/or marks the user as an old fogey who's likely to start
> lecturing about how a GiB isn't "small", as I'm known to do at times!
> =:^) already, as it's only going to be more so over time.

I am actually not fond of "disk" nor "device" as both carry potentially 
false information.

I prefer "slice", not that I am totally happy with that word either. But 
by the time you get through loopback devices, memory map devices, the 
"device files" that represent parts of "partitioned" devices, logical 
"volumes", and god only knows what future "thingies" we will end up 
dealing with... I like the terms that remove false hints.


In linux we (currently, and for the foreseeable future) use the device 
files and so conflate "device" with all the above.

But if the code base and format were to spread to another platform...

And besides, using device carries its own lingual hazzards.

"device 1 is a whole device /dev/sda, while device two is a partition on 
a partition called /dev/sdb1, and device three is on a partition called 
/dev/sdb2 which is really on the same device as the second device." etc.


"slice one is a whole device, /dev/sda; slice two is on a partition 
called /dev/sdb1; slice three is on a partition called /dev/sdb2, which 
shares the same device as slice two."

Much clearer when things get nasty.

"Slice" comes from programming, where arrays of storage can be "sliced" 
and recombined. The term was popularized (if memory serves) by Ada, not 
that Ada became popular. 8-)

You can have slices of anything, so like using a "slice of ram" makes sense.

It just seems like a waste to school yourself to eschew "disk" for 
"device" when the latter carries almost as much problematic baggage as 
the former.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/7] Add -v -q switches to mkfs.btrfs.
  2014-12-15 20:02 ` [PATCH 1/7] Add -v -q switches to mkfs.btrfs Goffredo Baroncelli
@ 2014-12-16  4:56   ` Satoru Takeuchi
  0 siblings, 0 replies; 22+ messages in thread
From: Satoru Takeuchi @ 2014-12-16  4:56 UTC (permalink / raw)
  To: Goffredo Baroncelli, linux-btrfs; +Cc: Goffredo Baroncelli

(2014/12/16 5:02), Goffredo Baroncelli wrote:
> Add -v -q switches to mkfs.btrfs, to control the verbosity of mkfs.btrfs.
> 
> Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>

Although this patch provides the interface of two new switches,
it doesn't work at all only by this patch. I consider providing
switch and its implementation at the same time is better.

So, I suggest you to ....

 a) merge "adding -v switch" part of this patch into 3/7, and
 b) merge "adding -q switch" part of this patch into 6/7 or
    Apply this part after 6/7 (without code for -q switch).

Thanks,
Satoru

> ---
>   mkfs.c | 16 ++++++++++++++--
>   1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/mkfs.c b/mkfs.c
> index e10e62d..26f8041 100644
> --- a/mkfs.c
> +++ b/mkfs.c
> @@ -288,8 +288,10 @@ static void print_usage(void)
>   	fprintf(stderr, "\t -r --rootdir the source directory\n");
>   	fprintf(stderr, "\t -K --nodiscard do not perform whole device TRIM\n");
>   	fprintf(stderr, "\t -O --features comma separated list of filesystem features\n");
> +	fprintf(stderr, "\t -q --quiet enable quiet mode\n");
>   	fprintf(stderr, "\t -U --uuid specify the filesystem UUID\n");
>   	fprintf(stderr, "\t -V --version print the mkfs.btrfs version and exit\n");
> +	fprintf(stderr, "\t -v --verbose enable verbose mode\n");
>   	fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
>   	exit(1);
>   }
> @@ -351,6 +353,8 @@ static struct option long_options[] = {
>   	{ "version", 0, NULL, 'V' },
>   	{ "rootdir", 1, NULL, 'r' },
>   	{ "nodiscard", 0, NULL, 'K' },
> +	{ "verbose", 0, NULL, 'v' },
> +	{ "quiet", 0, NULL, 'q' },
>   	{ "features", 1, NULL, 'O' },
>   	{ "uuid", required_argument, NULL, 'U' },
>   	{ NULL, 0, NULL, 0}
> @@ -998,7 +1002,7 @@ out:
>    * This ignores symlinks with unreadable targets and subdirs that can't
>    * be read.  It's a best-effort to give a rough estimate of the size of
>    * a subdir.  It doesn't guarantee that prepopulating btrfs from this
> - * tree won't still run out of space.
> + * tree won't still run out of space.
>    *
>    * The rounding up to 4096 is questionable.  Previous code used du -B 4096.
>    */
> @@ -1266,6 +1270,8 @@ int main(int ac, char **av)
>   	int discard = 1;
>   	int ssd = 0;
>   	int force_overwrite = 0;
> +	int verbose = 0;
> +	int quiet = 0;
>   
>   	char *source_dir = NULL;
>   	int source_dir_set = 0;
> @@ -1355,6 +1361,12 @@ int main(int ac, char **av)
>   			case 'K':
>   				discard = 0;
>   				break;
> +			case 'v':
> +				verbose = 1;
> +				break;
> +			case 'q':
> +				quiet = 1;
> +				break;
>   			default:
>   				print_usage();
>   		}
> @@ -1387,7 +1399,7 @@ int main(int ac, char **av)
>   			exit(1);
>   		}
>   	}
> -	
> +
>   	while (dev_cnt-- > 0) {
>   		file = av[optind++];
>   		if (is_block_device(file))
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] Print the summary
  2014-12-16  3:47     ` Robert White
@ 2014-12-16  9:05       ` Hugo Mills
  2014-12-16 21:40         ` Duncan
  2014-12-18  5:44         ` Robert White
  0 siblings, 2 replies; 22+ messages in thread
From: Hugo Mills @ 2014-12-16  9:05 UTC (permalink / raw)
  To: Robert White; +Cc: Duncan, linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 2708 bytes --]

On Mon, Dec 15, 2014 at 07:47:06PM -0800, Robert White wrote:
> On 12/15/2014 05:58 PM, Duncan wrote:
> >* Please s/disk/device/, here and possibly elsewhere.  I know I'm not the
> >only one who is trying to make the switch in my own usage, as it looks a
> >bit foolish (and/or marks the user as an old fogey who's likely to start
> >lecturing about how a GiB isn't "small", as I'm known to do at times!
> >=:^) already, as it's only going to be more so over time.
> 
> I am actually not fond of "disk" nor "device" as both carry
> potentially false information.
> 
> I prefer "slice", not that I am totally happy with that word either.
> But by the time you get through loopback devices, memory map
> devices, the "device files" that represent parts of "partitioned"
> devices, logical "volumes", and god only knows what future
> "thingies" we will end up dealing with... I like the terms that
> remove false hints.

   All this agreed, but "slice" will be largely viewed as a neologism
by anyone who hasn't used (IIRC) BSD or Solaris. On the other hand,
for all their other flaws, "device" is much better than "disk" here,
as you could he talking about a partition, a flash memory card (which
many people don't view as "disks"), or a network block device. You
could refer to a "block device" to clarify, because that's really what
we're talking about here, but it could get a bit cumbersome.

   Hugo.

> In linux we (currently, and for the foreseeable future) use the
> device files and so conflate "device" with all the above.
> 
> But if the code base and format were to spread to another platform...
> 
> And besides, using device carries its own lingual hazzards.
> 
> "device 1 is a whole device /dev/sda, while device two is a
> partition on a partition called /dev/sdb1, and device three is on a
> partition called /dev/sdb2 which is really on the same device as the
> second device." etc.
> 
> 
> "slice one is a whole device, /dev/sda; slice two is on a partition
> called /dev/sdb1; slice three is on a partition called /dev/sdb2,
> which shares the same device as slice two."
> 
> Much clearer when things get nasty.
> 
> "Slice" comes from programming, where arrays of storage can be
> "sliced" and recombined. The term was popularized (if memory serves)
> by Ada, not that Ada became popular. 8-)
> 
> You can have slices of anything, so like using a "slice of ram" makes sense.
> 
> It just seems like a waste to school yourself to eschew "disk" for
> "device" when the latter carries almost as much problematic baggage
> as the former.

-- 
Hugo Mills             | Great films about cricket: 200/1: A Pace Odyssey
hugo@... carfax.org.uk |
http://carfax.org.uk/  |
PGP: 65E74AC0          |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] Print the summary
  2014-12-16  9:05       ` Hugo Mills
@ 2014-12-16 21:40         ` Duncan
  2014-12-18  5:44         ` Robert White
  1 sibling, 0 replies; 22+ messages in thread
From: Duncan @ 2014-12-16 21:40 UTC (permalink / raw)
  To: linux-btrfs

Hugo Mills posted on Tue, 16 Dec 2014 09:05:40 +0000 as excerpted:

> On Mon, Dec 15, 2014 at 07:47:06PM -0800, Robert White wrote:
>> On 12/15/2014 05:58 PM, Duncan wrote:
>> >* Please s/disk/device/, here and possibly elsewhere.  I know I'm not
>> >the only one who is trying to make the switch in my own usage, as it
>> >looks a bit foolish (and/or marks the user as an old fogey who's
>> >likely to start lecturing about how a GiB isn't "small", as I'm known
>> >to do at times! =:^) already, as it's only going to be more so over
>> >time.
>> 
>> I am actually not fond of "disk" nor "device" as both carry potentially
>> false information.
>> 
>> I prefer "slice", not that I am totally happy with that word either.
>> But by the time you get through loopback devices, memory map devices,
>> the "device files" that represent parts of "partitioned" devices,
>> logical "volumes", and god only knows what future "thingies" we will
>> end up dealing with... I like the terms that remove false hints.
> 
> All this agreed, but "slice" will be largely viewed as a neologism
> by anyone who hasn't used (IIRC) BSD or Solaris. On the other hand, for
> all their other flaws, "device" is much better than "disk" here, as you
> could he talking about a partition, a flash memory card (which many
> people don't view as "disks"), or a network block device. You could
> refer to a "block device" to clarify, because that's really what we're
> talking about here, but it could get a bit cumbersome.

Agreed.  I've only seen "slice" in the bsd context and don't even know 
how the word is used, only that it's something from BSD land that I've 
seen in the context of partitions.

Device seems much more natural at least on Linux, and if btrfs is 
eventually used elsewhere where concepts and/or terminology is different, 
that'll be something they'll deal with in the btrfs context much as I'd 
expect to have to deal with a number of context-specific terms and 
meanings were I to run zfs on Linux[1].

>> In linux we (currently, and for the foreseeable future) use the device
>> files and so conflate "device" with all the above.
>> 
>> But if the code base and format were to spread to another platform...
>> 
>> And besides, using device carries its own lingual hazzards.

That "device" is such a flexible term at least on Linux, where devices 
can be and often are nested and/or virtual as well as physical, is 
actually its big advantage here, IMO.  And FWIW, the only difference I 
saw between slice and device in your example is exactly as discussed, 
they seemed to be used in almost exactly the same way, only "device" is a 
term native to linux, while slice sounds like we're trying to borrow bsd 
terminology and make them fit on linux, for no good reason given that 
"device" is a linux-native term that appears to work just as well in the 
context in which it is used.

---
[1] Zfs on linux: Not an option here for licensing reasons and because it 
appears Oracle has absolutely no interest in clearing up the problem, but 
that's certainly the most comparable thing to btrfs at this point, with 
the biggest technical difference being its relative maturity, tho from 
what I have read there's a big practical difference in hardware 
requirements (much higher memory requirements and ECC RAM very strongly 
recommended) as well.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
                   ` (7 preceding siblings ...)
  2014-12-16  3:23 ` [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Satoru Takeuchi
@ 2014-12-17 14:29 ` David Sterba
  2014-12-17 15:08 ` Holger Hoffstätte
  9 siblings, 0 replies; 22+ messages in thread
From: David Sterba @ 2014-12-17 14:29 UTC (permalink / raw)
  To: Goffredo Baroncelli; +Cc: linux-btrfs

On Mon, Dec 15, 2014 at 09:02:53PM +0100, Goffredo Baroncelli wrote:
> enclosed a patches set to improve the output of mkfs.btrfs command.
>
> Currently I find the output of mkfs.btrfs command quite confusing:

Thanks. I've marked the wiki://Project_ideas item as claimed.

> After my patches the output becomes:
> 
> # mkfs.btrfs -f -d raid5 -m raid5 /dev/vd[b-k] 
> BTRFS filesystem summary:
>   Label:		btrfs-test
>   UUID:			1073cb19-b675-423d-9aba-caad7f1508a8
> 
>   Node size:		16384
>   Leaf size:		16384
>   Sector size:		4096
>   Initial chunks:
>     Data:		9.01GiB
>     Metadata:		3.61GiB
>     System:		18.06MiB
>   Metadata profile:	RAID5
>   Data profile:		RAID5
>   Mixed mode:		NO
>   SSD detected:		NO
>   Features:		extref, raid56
>   Number of devices:	10
>     UUID                                  ID    SIZE    PATH
>     ------------------------------------  --  --------- -----------
>     62121322-5666-4ecf-bc8e-c9b3d9f60db9   1   50.00GiB /dev/vdb
>     6158cb13-3ae8-42b6-8603-660f1e5c8a7a   2   50.00GiB /dev/vdc
>     b49516db-ddf5-4f54-8831-a4babc79e901   3   50.00GiB /dev/vdd
>     00b03d81-7d29-4894-8050-9dd205f97c41   4   50.00GiB /dev/vde
>     f119a2ec-5ef0-436c-805e-c1b0612b05ca   5   50.00GiB /dev/vdf
>     adee4f58-e094-4bd4-8c56-941527524f8d   6   50.00GiB /dev/vdg
>     a8299171-2024-4057-ba56-1f83bf6d7e2e   7   50.00GiB /dev/vdh
>     b694e275-e454-4dbd-beb0-e33c388cffa2   8    2.00GiB /dev/vdi
>     7cbe04b5-36cd-4ea7-be82-206d5487914e   9    2.00GiB /dev/vdj
>     7c320654-675e-456b-ac23-cfb148b8ea57  10    2.00GiB /dev/vdk
> 
>   Total disks size:                           356.01GiB

The output looks good to me, I'll get back to this patchset after 3.18
is released, so there's enough time to gather feedback.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command
  2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
                   ` (8 preceding siblings ...)
  2014-12-17 14:29 ` David Sterba
@ 2014-12-17 15:08 ` Holger Hoffstätte
  9 siblings, 0 replies; 22+ messages in thread
From: Holger Hoffstätte @ 2014-12-17 15:08 UTC (permalink / raw)
  To: linux-btrfs

On Mon, 15 Dec 2014 21:02:53 +0100, Goffredo Baroncelli wrote:

> enclosed a patches set to improve the output of mkfs.btrfs command.

This is very nice! I do have a comment about the device list:

> ..
>     UUID                                  ID    SIZE    PATH
>     ------------------------------------  --  --------- -----------
>     62121322-5666-4ecf-bc8e-c9b3d9f60db9   1   50.00GiB /dev/vdb
>     6158cb13-3ae8-42b6-8603-660f1e5c8a7a   2   50.00GiB /dev/vdc
>     b49516db-ddf5-4f54-8831-a4babc79e901   3   50.00GiB /dev/vdd
>     00b03d81-7d29-4894-8050-9dd205f97c41   4   50.00GiB /dev/vde
>     f119a2ec-5ef0-436c-805e-c1b0612b05ca   5   50.00GiB /dev/vdf
>     adee4f58-e094-4bd4-8c56-941527524f8d   6   50.00GiB /dev/vdg
>     a8299171-2024-4057-ba56-1f83bf6d7e2e   7   50.00GiB /dev/vdh
>     b694e275-e454-4dbd-beb0-e33c388cffa2   8    2.00GiB /dev/vdi
>     7cbe04b5-36cd-4ea7-be82-206d5487914e   9    2.00GiB /dev/vdj
>     7c320654-675e-456b-ac23-cfb148b8ea57  10    2.00GiB /dev/vdk
> 
>   Total disks size:                           356.01GiB

I'm not sure how others feel about this, but the first column of UUIDs
contains almost no human-usable information (who remembers UUIDs?) but
takes up a huge chunk of the screen real estate. I'd suggest to reorder
the columns to be something like (ID, Size, Path, UUID). This puts more
relevant information in reading-order.

I hope this isn't too much to ask :)

thanks
Holger


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] Print the summary
  2014-12-16  1:58   ` Duncan
  2014-12-16  3:47     ` Robert White
@ 2014-12-17 18:59     ` Goffredo Baroncelli
  1 sibling, 0 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-17 18:59 UTC (permalink / raw)
  To: Duncan, linux-btrfs

On 12/16/2014 02:58 AM, Duncan wrote:
> Goffredo Baroncelli posted on Mon, 15 Dec 2014 21:02:59 +0100 as
> excerpted:
> 
>> +	printf("  Total disks size:                          %10s\n",
>> +		pretty_size(total_block_count));
> 
> I really like this patch series. Makes mkfs.btrfs much nicer to use. =:^)
> 
> I'm not a dev and won't attempt a technical review, but three very minor 
> and quick nits:
> 
> * Please s/disk/device/, here and possibly elsewhere.  I know I'm not the 
> only one who is trying to make the switch in my own usage, as it looks a 
> bit foolish (and/or marks the user as an old fogey who's likely to start 
> lecturing about how a GiB isn't "small", as I'm known to do at times! 
> =:^) already, as it's only going to be more so over time.

Ok, I agree

> 
> * patch title typo and omission, patch 7:  There's a good chance you 
> already caught it, but just in case, for the next version, s/-o/-q/, and 
> please mention it's /documentation/ that's patched here (patch 1 adds the 
> switches to the code).

Ok
> 
> * Also in patch 7, first chunk, -q|--quiet is added twice...

good catch for that
> 


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command
  2014-12-16  3:23 ` [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Satoru Takeuchi
@ 2014-12-17 19:49   ` Goffredo Baroncelli
  0 siblings, 0 replies; 22+ messages in thread
From: Goffredo Baroncelli @ 2014-12-17 19:49 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: linux-btrfs

On 12/16/2014 04:23 AM, Satoru Takeuchi wrote:
> Hi Goffredo,
[...]
> 
> It removes "Incompat" from original message. I consider
> "Backward Incompatible Feature" is better. I consider,
> the word, "incompatible", is very important for users.

Right, another good catch.
> 
> In addition, original version (without your patch) has
> the message turning on mixed-bg. However, the "Features"
> line of new version doesn't show mixed-bg. Is it a bug
> or am I missing something?

In my second example I didn't pass the -M switch. This is the reason
why mixed-bg is missing.

Below the new example (I update the code a bit)

# mkfs.btrfs -L btrfs-test -f -M -m raid5 -d raid5 /dev/vd[b-k]"
BTRFS filesystem summary:
  Label:		btrfs-test
  UUID:			d1581dc6-d07b-40d4-8d9e-0e0810e43839

  Node size:		4096
  Leaf size:		4096
  Sector size:		4096
  Initial chunks:
    Data+Metadata:	9.01GiB
    System:		18.06MiB
  Metadata profile:	RAID5
  Data profile:		RAID5
  Mixed mode:		YES
  SSD detected:		NO
  Incompat features:	mixed-bg, extref, raid56
  Number of devices:	10
    UUID                                  ID    SIZE    PATH
    ------------------------------------  --  --------- -----------
    816b6fe0-5672-429f-9a8e-e5be363abc7f   1   50.00GiB /dev/vdb
    86e54b61-7856-4ad8-bb03-39c018b6fbc0   2   50.00GiB /dev/vdc
    bca3a70d-32d0-40d1-8cdf-a77338c7dd09   3   50.00GiB /dev/vdd
    2838c80f-080c-4c75-a351-525243f8b710   4   50.00GiB /dev/vde
    b00e139d-f4d5-426e-8670-2f6b6cac4e8c   5   50.00GiB /dev/vdf
    95f3a828-fdfc-4f06-882d-eda6c91b0ad1   6   50.00GiB /dev/vdg
    5a0083d6-edf2-4d50-b60e-0e44773f1543   7   50.00GiB /dev/vdh
    d89b09dc-269c-40bc-9807-07c6ca5aa638   8    2.00GiB /dev/vdi
    ffc6a0f0-2659-41a8-b8ae-0ffe931c5eff   9    2.00GiB /dev/vdj
    5bd84fa0-7055-4090-89b7-a1fac849c11c  10    2.00GiB /dev/vdk

  Total devices size:                         356.01GiB



> 
> Thanks,
> Satoru
> 
>>    Number of devices:	10
>>      UUID                                  ID    SIZE    PATH
>>      ------------------------------------  --  --------- -----------
>>      62121322-5666-4ecf-bc8e-c9b3d9f60db9   1   50.00GiB /dev/vdb
>>      6158cb13-3ae8-42b6-8603-660f1e5c8a7a   2   50.00GiB /dev/vdc
>>      b49516db-ddf5-4f54-8831-a4babc79e901   3   50.00GiB /dev/vdd
>>      00b03d81-7d29-4894-8050-9dd205f97c41   4   50.00GiB /dev/vde
>>      f119a2ec-5ef0-436c-805e-c1b0612b05ca   5   50.00GiB /dev/vdf
>>      adee4f58-e094-4bd4-8c56-941527524f8d   6   50.00GiB /dev/vdg
>>      a8299171-2024-4057-ba56-1f83bf6d7e2e   7   50.00GiB /dev/vdh
>>      b694e275-e454-4dbd-beb0-e33c388cffa2   8    2.00GiB /dev/vdi
>>      7cbe04b5-36cd-4ea7-be82-206d5487914e   9    2.00GiB /dev/vdj
>>      7c320654-675e-456b-ac23-cfb148b8ea57  10    2.00GiB /dev/vdk
>>
>>    Total disks size:                           356.01GiB
>>
>>
>> Each information is in its own row. The disks are listed with more
>> information (disk uuid, id, size of each disk...)
>> Nodesize, Leafsize, Sectorsize are separated by the filesystem size.
>>
>> The metadata/data profile are displayed (before this information was missed).
>> Also the size of the data/metadata/system chunk are displayed.
>>
>> This is an RFC to collect suggestions.
>>
>>
>> These changes are also available via github
>> https://github.com/kreijack/btrfs-progs/commit/44fc80342b9c238f41b803cb0b9b4efe9b66d56f
>>
>>
>> BR
>> G.Baroncelli
>>
>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/7] Print the summary
  2014-12-16  9:05       ` Hugo Mills
  2014-12-16 21:40         ` Duncan
@ 2014-12-18  5:44         ` Robert White
  2014-12-18  8:41           ` Terminology (was Re: [PATCH 6/7] Print the summary) Hugo Mills
  1 sibling, 1 reply; 22+ messages in thread
From: Robert White @ 2014-12-18  5:44 UTC (permalink / raw)
  To: Hugo Mills, Duncan, linux-btrfs

On 12/16/2014 01:05 AM, Hugo Mills wrote:
> On Mon, Dec 15, 2014 at 07:47:06PM -0800, Robert White wrote:
>> I prefer "slice", not that I am totally happy with that word either.
>> But by the time you get through loopback devices, memory map
>> devices, the "device files" that represent parts of "partitioned"
>> devices, logical "volumes", and god only knows what future
>> "thingies" we will end up dealing with... I like the terms that
>> remove false hints.
>
>     All this agreed, but "slice" will be largely viewed as a neologism
> by anyone who hasn't used (IIRC) BSD or Solaris. On the other hand,
> for all their other flaws, "device" is much better than "disk" here,
> as you could he talking about a partition, a flash memory card (which
> many people don't view as "disks"), or a network block device. You
> could refer to a "block device" to clarify, because that's really what
> we're talking about here, but it could get a bit cumbersome.

That's part of why I'm not perfectly happy with slice either.

But just last week I was trying to explain the whole thing of being out 
of raw space to allocate storage extents compared to being out of 
managed space to allocate file, um, extents...

And I'm currently going around in circles over whole "when is a sector 
free" as far as /bin/df is concerned...


we've got devices as we view them which are parts of devices as the ...

We've got storage extents and we are dealing with people who are used to 
seeing "extent" used as the name of contiguously stored sections of 
files, but our extents store segments of the devices.

We've also got those two-disk raid-5(s) which we've established are 
mathematically correct, but which will trip up everyone that is used to 
the three-or-more rule.

Then using the variable bytenr instead of byte_number (when all the rest 
of the variables are spelled out) and I'm not sure if thats in the 
logical view or the physical layout view, or both.

In short (too late) there is a huge lexicon problem to newcomers here 
because of noun-overloading (in the programmatic sense).

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Terminology (was Re: [PATCH 6/7] Print the summary)
  2014-12-18  5:44         ` Robert White
@ 2014-12-18  8:41           ` Hugo Mills
  2014-12-22 18:38             ` David Sterba
  0 siblings, 1 reply; 22+ messages in thread
From: Hugo Mills @ 2014-12-18  8:41 UTC (permalink / raw)
  To: Robert White; +Cc: Duncan, linux-btrfs, David Sterba

[-- Attachment #1: Type: text/plain, Size: 3372 bytes --]

On Wed, Dec 17, 2014 at 09:44:43PM -0800, Robert White wrote:
> On 12/16/2014 01:05 AM, Hugo Mills wrote:
> >On Mon, Dec 15, 2014 at 07:47:06PM -0800, Robert White wrote:
> >>I prefer "slice", not that I am totally happy with that word either.
> >>But by the time you get through loopback devices, memory map
> >>devices, the "device files" that represent parts of "partitioned"
> >>devices, logical "volumes", and god only knows what future
> >>"thingies" we will end up dealing with... I like the terms that
> >>remove false hints.
> >
> >    All this agreed, but "slice" will be largely viewed as a neologism
> >by anyone who hasn't used (IIRC) BSD or Solaris. On the other hand,
> >for all their other flaws, "device" is much better than "disk" here,
> >as you could he talking about a partition, a flash memory card (which
> >many people don't view as "disks"), or a network block device. You
> >could refer to a "block device" to clarify, because that's really what
> >we're talking about here, but it could get a bit cumbersome.
> 
> That's part of why I'm not perfectly happy with slice either.
> 
> But just last week I was trying to explain the whole thing of being
> out of raw space to allocate storage extents compared to being out
> of managed space to allocate file, um, extents...
> 
> And I'm currently going around in circles over whole "when is a
> sector free" as far as /bin/df is concerned...
> 
> 
> we've got devices as we view them which are parts of devices as the ...
> 
> We've got storage extents and we are dealing with people who are
> used to seeing "extent" used as the name of contiguously stored
> sections of files, but our extents store segments of the devices.

   "...our extents store segments of the devices" _as well_, and that
term doesn't tend to leak out into public discussions. They're also
arked with a different record type in the extent tree, IIRC.

> We've also got those two-disk raid-5(s) which we've established are
> mathematically correct, but which will trip up everyone that is used
> to the three-or-more rule.

   I don't buy this one. You're the first person who's complained
about the use of the parity RAID names. However, we've had plenty of
people complaining about the RAID-1 term.

   As I said at the time, maybe we need to revisit the RAID vocabulary
completely and move to a more flexible terminology.

   David -- would you accept the cNsMpP patches if I revisted them?

> Then using the variable bytenr instead of byte_number (when all the
> rest of the variables are spelled out) and I'm not sure if thats in
> the logical view or the physical layout view, or both.

   Everything is in the logical view, unless you're looking at the
chunk tree, which does that mapping.

> In short (too late) there is a huge lexicon problem to newcomers
> here because of noun-overloading (in the programmatic sense).

   The extents and bytenr concerns don't leak out into the public
(user) arena. RAID is a known problem with a proposed solution. I
don't see this as being *huge* -- not in the same way that space
reporting to users is huge.

   Hugo.

-- 
Hugo Mills             | Always be sincere, whether you mean it or not.
hugo@... carfax.org.uk |
http://carfax.org.uk/  |                                      Flanders & Swann
PGP: 65E74AC0          |                                The Reluctant Cannibal

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Terminology (was Re: [PATCH 6/7] Print the summary)
  2014-12-18  8:41           ` Terminology (was Re: [PATCH 6/7] Print the summary) Hugo Mills
@ 2014-12-22 18:38             ` David Sterba
  0 siblings, 0 replies; 22+ messages in thread
From: David Sterba @ 2014-12-22 18:38 UTC (permalink / raw)
  To: Hugo Mills, Robert White, Duncan, linux-btrfs

On Thu, Dec 18, 2014 at 08:41:31AM +0000, Hugo Mills wrote:
>    As I said at the time, maybe we need to revisit the RAID vocabulary
> completely and move to a more flexible terminology.
> 
>    David -- would you accept the cNsMpP patches if I revisted them?

I personally like the new naming scheme and would like to see it merged,
but I don't know about other devs so more acks are needed. The changes
in code do not apply now, but are fairly easy to forward port so I don't
urge you to do that. I've noticed a few backward compatibility issues
that are not addressed in the patches v2, eg. that the old raid naming
is not accepted in mkfs without an extra option.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-12-22 18:38 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 20:02 [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Goffredo Baroncelli
2014-12-15 20:02 ` [PATCH 1/7] Add -v -q switches to mkfs.btrfs Goffredo Baroncelli
2014-12-16  4:56   ` Satoru Takeuchi
2014-12-15 20:02 ` [PATCH 2/7] Move group_profile_str() in utils.c Goffredo Baroncelli
2014-12-15 20:02 ` [PATCH 3/7] Add verbose option to btrfs_add_to_fsid() Goffredo Baroncelli
2014-12-15 20:02 ` [PATCH 4/7] Add strdup in btrfs_add_to_fsid() to track the device path Goffredo Baroncelli
2014-12-15 20:02 ` [PATCH 5/7] Return the fsid from make_btrfs() Goffredo Baroncelli
2014-12-15 20:02 ` [PATCH 6/7] Print the summary Goffredo Baroncelli
2014-12-16  1:58   ` Duncan
2014-12-16  3:47     ` Robert White
2014-12-16  9:05       ` Hugo Mills
2014-12-16 21:40         ` Duncan
2014-12-18  5:44         ` Robert White
2014-12-18  8:41           ` Terminology (was Re: [PATCH 6/7] Print the summary) Hugo Mills
2014-12-22 18:38             ` David Sterba
2014-12-17 18:59     ` [PATCH 6/7] Print the summary Goffredo Baroncelli
2014-12-16  3:27   ` Satoru Takeuchi
2014-12-15 20:03 ` [PATCH 7/7] Add -v and -o switches Goffredo Baroncelli
2014-12-16  3:23 ` [RFC][BTRFS-PROGS] Improve output of mkfs.btrfs command Satoru Takeuchi
2014-12-17 19:49   ` Goffredo Baroncelli
2014-12-17 14:29 ` David Sterba
2014-12-17 15:08 ` Holger Hoffstätte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.