linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/2 resend] btrfs-progs: v4, move out print in cmd_df to another function
@ 2013-09-13 10:44 Anand Jain
  0 siblings, 0 replies; 3+ messages in thread
From: Anand Jain @ 2013-09-13 10:44 UTC (permalink / raw)
  To: dsterba; +Cc: linux-btrfs



 all of them were considered, v5 sent out.

Thanks, Anand

> -	path = argv[1];
> +	switch (flag & BTRFS_BLOCK_GROUP_TYPE_MASK) {
> +	case BTRFS_BLOCK_GROUP_DATA:
> +		return "data";
> +	case BTRFS_BLOCK_GROUP_SYSTEM:
> +		return "system";
> +	case BTRFS_BLOCK_GROUP_METADATA:
> +		return "metadata";
> +	case BTRFS_BLOCK_GROUP_DATA|BTRFS_BLOCK_GROUP_METADATA:
> +		return "mixed";

I think the profile names should stay unchanged, ie Data, System etc,
and Data+Metadata instead of mixed. We can change the output format
later, but for this preparatory patch I'd stick with what it is.


> +	default:
> +		return "unknown";
> +	}
> +}
>  
> -	fd = open_file_or_dir(path, &dirstream);
> -	if (fd < 0) {
> -		fprintf(stderr, "ERROR: can't access to '%s'\n", path);
> -		return 12;
> +static char *group_profile_str(u64 flag)
> +{
> +	switch (flag & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
> +	case 0:
> +		return "single";

The 'single' profile was not explicitly mentioned before, I tend to
think that it's better to be consistent with the rest and add it as you
do in this patch.

Sample output:

$ ./btrfs fi df /mnt/enospc/mnt
data, single: total=5.92GiB, used=4.41GiB
system, DUP: total=8.00MiB, used=4.00KiB
system, single: total=4.00MiB, used=0.00
metadata, DUP: total=1.02GiB, used=828.10MiB
metadata, single: total=8.00MiB, used=0.00

looks imho ok.
--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH 0/2] v2, fi show, dev scan and lblkid
@ 2013-08-30  8:35 Anand Jain
  2013-09-06  9:37 ` [PATCH 1/2 resend] btrfs-progs: v4, move out print in cmd_df to another function Anand Jain
  0 siblings, 1 reply; 3+ messages in thread
From: Anand Jain @ 2013-08-30  8:35 UTC (permalink / raw)
  To: linux-btrfs

  This patch set is about
  use of lblkid for the btrfs disk scan and
  using this lblkid scan for the fi show and dev scan cli

  This includes the comments from David (to use lblkid)
  and Zach to show (btrfs fi show) info from kernel when
  disk is mounted and from the disks directly when disk
  is unmounted

v2:
  In an effort fix checkpath.pl errors as suggested in
  Wang's review, the two patches as below is merged
  into one

btrfs-progs: read from the kernel when disk is mounted
btrfs-progs: use lblkid to scan and filesystem show improvements

Anand Jain (2):
  btrfs-progs: v4, move out print in cmd_df to another function
  btrfs-progs: use kernel for mounted and lblkid to scan disks

 cmds-device.c     |   21 +---
 cmds-filesystem.c |  361 ++++++++++++++++++++++++++++++++++-------------------
 ctree.h           |   11 ++
 utils.c           |   55 ++++++++-
 utils.h           |    7 +-
 5 files changed, 304 insertions(+), 151 deletions(-)


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

end of thread, other threads:[~2013-09-13 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-13 10:44 [PATCH 1/2 resend] btrfs-progs: v4, move out print in cmd_df to another function Anand Jain
  -- strict thread matches above, loose matches on Subject: below --
2013-08-30  8:35 [PATCH 0/2] v2, fi show, dev scan and lblkid Anand Jain
2013-09-06  9:37 ` [PATCH 1/2 resend] btrfs-progs: v4, move out print in cmd_df to another function Anand Jain
2013-09-12 15:42   ` David Sterba

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).