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
Subject: [PATCH 2/3 v2] btrfs-progs: add more parameter to the filesystem show
Date: Tue,  8 Oct 2013 11:41:39 +0800	[thread overview]
Message-ID: <1381203700-17558-2-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1381203700-17558-1-git-send-email-anand.jain@oracle.com>

for mounted btrfs filesystem this patch proposes to add
mount point and group profile to the filesystem show output.
this helps user to quickly understand short details of the
btrfs filesystem quickly.

end user using this new btrfs fi show would surely notice this
will reduce other commands normally used following the current
btrfs fi show command. (like mount and btrfs fi df). of course
user should use fi df to know detailed info about the sizes.

preview as below..

Label: none  uuid: 26d539a5-8968-4cf0-b4b5-5fd50105f8a0 mounted: /btrfs
	Group profile: Metadata: single  Metadata: DUP  Data: single
	Total devices 1 FS bytes used 28.00KiB
	devid    1 size 1.98GiB used 238.25MiB path /dev/mapper/mpatha

v2: commit message edited.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 cmds-filesystem.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 9e0c8b9..74b7a06 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -273,10 +273,21 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info,
 	int i;
 	char uuidbuf[37];
 	struct btrfs_ioctl_dev_info_args *tmp_dev_info;
+	u64 flags;
 
 	uuid_unparse(fs_info->fsid, uuidbuf);
-	printf("Label: %s  uuid: %s\n",
-		strlen(label) ? label : "none", uuidbuf);
+	printf("Label: %s  uuid: %s mounted: %s\n",
+		strlen(label) ? label : "none", uuidbuf, path);
+	printf("\tGroup profile:");
+	for (i = space_info->total_spaces - 1; i >= 0; i--) {
+		flags = space_info->spaces[i].flags;
+		if (flags & BTRFS_BLOCK_GROUP_SYSTEM)
+			continue;
+		printf(" %s: %s", group_type_str(flags),
+					group_profile_str(flags));
+		printf(" ");
+	}
+	printf("\n");
 
 	printf("\tTotal devices %llu FS bytes used %s\n",
 				fs_info->num_devices,
-- 
1.7.1


  reply	other threads:[~2013-10-08  3:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08  3:41 [PATCH 1/3 v4] btrfs-progs: use kernel for mounted disk for show Anand Jain
2013-10-08  3:41 ` Anand Jain [this message]
2013-10-15 17:22   ` [PATCH 2/3 v2] btrfs-progs: add more parameter to the filesystem show David Sterba
2013-10-16  2:22     ` Anand Jain
2013-10-08  3:41 ` [PATCH 3/3] btrfs-progs: use BTRFS_SCAN_LBLKID as default scan in " Anand Jain
2013-10-15 17:13 ` [PATCH 1/3 v4] btrfs-progs: use kernel for mounted disk for show David Sterba
2013-10-16  9:25   ` Anand Jain
2013-10-16 13:09     ` David Sterba
2013-10-21 14:44   ` Josef Bacik
2013-10-22  5:53     ` Anand Jain
2013-10-22 13:21       ` Josef Bacik
2013-10-22 13:28         ` Hugo Mills
2013-10-22 16:52         ` David Sterba
2013-10-23 11:20           ` Anand Jain
2013-10-23 11:41             ` Anand Jain

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=1381203700-17558-2-git-send-email-anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --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).