Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs-progs: qgroup: show 'none' when we did not limit it on this qgroup
@ 2015-06-03  6:57 Dongsheng Yang
  2015-06-03  6:57 ` [PATCH] btrfs: qgroup: allow user to clear the limitation on qgroup Dongsheng Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Dongsheng Yang @ 2015-06-03  6:57 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Dongsheng Yang

There are two understanding of the '0' value in btrfs qgroup show.
(1) is no-limitation on this qgroup. (2) is the max-limitation is 0.

This patch make it showing in different way.

(1). max-limitation for 0 is still showing '0'.
(2). no-limitation will show 'none'.

qgroupid         rfer         excl     max_rfer     max_excl parent
--------         ----         ----     --------     -------- ------
0/5           2.19GiB      2.19GiB         none         none ---
0/257       100.02MiB    100.02MiB         none         none ---

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 qgroup.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/qgroup.c b/qgroup.c
index 53815b5..dc04b03 100644
--- a/qgroup.c
+++ b/qgroup.c
@@ -237,10 +237,16 @@ static void print_qgroup_column(struct btrfs_qgroup *qgroup,
 		print_qgroup_column_add_blank(BTRFS_QGROUP_PARENT, len);
 		break;
 	case BTRFS_QGROUP_MAX_RFER:
-		len = printf("%*s", max_len, pretty_size_mode(qgroup->max_rfer, unit_mode));
+		if (qgroup->flags & BTRFS_QGROUP_LIMIT_MAX_RFER)
+			len = printf("%*s", max_len, pretty_size_mode(qgroup->max_rfer, unit_mode));
+		else
+			len = printf("%*s", max_len, "none");
 		break;
 	case BTRFS_QGROUP_MAX_EXCL:
-		len = printf("%*s", max_len, pretty_size_mode(qgroup->max_excl, unit_mode));
+		if (qgroup->flags & BTRFS_QGROUP_LIMIT_MAX_EXCL)
+			len = printf("%*s", max_len, pretty_size_mode(qgroup->max_excl, unit_mode));
+		else
+			len = printf("%*s", max_len, "none");
 		break;
 	case BTRFS_QGROUP_CHILD:
 		len = print_child_column(qgroup);
-- 
1.8.4.2


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

end of thread, other threads:[~2015-06-05 16:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03  6:57 [PATCH 1/2] btrfs-progs: qgroup: show 'none' when we did not limit it on this qgroup Dongsheng Yang
2015-06-03  6:57 ` [PATCH] btrfs: qgroup: allow user to clear the limitation on qgroup Dongsheng Yang
2015-06-03  8:18   ` Tsutomu Itoh
2015-06-03  6:57 ` [PATCH 2/2] btrfs-progs: qgroup: allow user to clear some " Dongsheng Yang
2015-06-03  8:40   ` Tsutomu Itoh
2015-06-03  8:41     ` Dongsheng Yang
2015-06-05 16:37   ` David Sterba
2015-06-03  8:14 ` [PATCH 1/2] btrfs-progs: qgroup: show 'none' when we did not limit it on this qgroup Tsutomu Itoh
2015-06-05 16:36 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox