mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-07 18:37:56 +00:00
Btrfs-progs: introduce '-e' option to print max exclusive size of qgroups
This patch introduce '-e' option to print max exclusive size of qgroups. You may use it like this: btrfs qgroup -e <path> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
0944502866
commit
ae26ff16f8
@ -202,11 +202,12 @@ static int cmd_qgroup_destroy(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char * const cmd_qgroup_show_usage[] = {
|
static const char * const cmd_qgroup_show_usage[] = {
|
||||||
"btrfs qgroup show -pcr <path>",
|
"btrfs qgroup show -pcre <path>",
|
||||||
"Show all subvolume quota groups.",
|
"Show all subvolume quota groups.",
|
||||||
"-p print parent qgroup id",
|
"-p print parent qgroup id",
|
||||||
"-c print child qgroup id",
|
"-c print child qgroup id",
|
||||||
"-r print max referenced size of qgroup",
|
"-r print max referenced size of qgroup",
|
||||||
|
"-e print max exclusive size of qgroup",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -221,7 +222,7 @@ static int cmd_qgroup_show(int argc, char **argv)
|
|||||||
|
|
||||||
optind = 1;
|
optind = 1;
|
||||||
while (1) {
|
while (1) {
|
||||||
c = getopt(argc, argv, "pcr");
|
c = getopt(argc, argv, "pcre");
|
||||||
if (c < 0)
|
if (c < 0)
|
||||||
break;
|
break;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@ -237,6 +238,10 @@ static int cmd_qgroup_show(int argc, char **argv)
|
|||||||
btrfs_qgroup_setup_print_column(
|
btrfs_qgroup_setup_print_column(
|
||||||
BTRFS_QGROUP_MAX_RFER);
|
BTRFS_QGROUP_MAX_RFER);
|
||||||
break;
|
break;
|
||||||
|
case 'e':
|
||||||
|
btrfs_qgroup_setup_print_column(
|
||||||
|
BTRFS_QGROUP_MAX_EXCL);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage(cmd_qgroup_show_usage);
|
usage(cmd_qgroup_show_usage);
|
||||||
}
|
}
|
||||||
|
8
qgroup.c
8
qgroup.c
@ -91,6 +91,11 @@ struct {
|
|||||||
.column_name = "Max_rfer",
|
.column_name = "Max_rfer",
|
||||||
.need_print = 0,
|
.need_print = 0,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.name = "max_excl",
|
||||||
|
.column_name = "Max_excl",
|
||||||
|
.need_print = 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.name = "parent",
|
.name = "parent",
|
||||||
.column_name = "Parent",
|
.column_name = "Parent",
|
||||||
@ -173,6 +178,9 @@ static void print_qgroup_column(struct btrfs_qgroup *qgroup,
|
|||||||
case BTRFS_QGROUP_MAX_RFER:
|
case BTRFS_QGROUP_MAX_RFER:
|
||||||
printf("%llu", qgroup->max_rfer);
|
printf("%llu", qgroup->max_rfer);
|
||||||
break;
|
break;
|
||||||
|
case BTRFS_QGROUP_MAX_EXCL:
|
||||||
|
printf("%llu", qgroup->max_excl);
|
||||||
|
break;
|
||||||
case BTRFS_QGROUP_CHILD:
|
case BTRFS_QGROUP_CHILD:
|
||||||
print_child_column(qgroup);
|
print_child_column(qgroup);
|
||||||
break;
|
break;
|
||||||
|
1
qgroup.h
1
qgroup.h
@ -27,6 +27,7 @@ enum btrfs_qgroup_column_enum {
|
|||||||
BTRFS_QGROUP_RFER,
|
BTRFS_QGROUP_RFER,
|
||||||
BTRFS_QGROUP_EXCL,
|
BTRFS_QGROUP_EXCL,
|
||||||
BTRFS_QGROUP_MAX_RFER,
|
BTRFS_QGROUP_MAX_RFER,
|
||||||
|
BTRFS_QGROUP_MAX_EXCL,
|
||||||
BTRFS_QGROUP_PARENT,
|
BTRFS_QGROUP_PARENT,
|
||||||
BTRFS_QGROUP_CHILD,
|
BTRFS_QGROUP_CHILD,
|
||||||
BTRFS_QGROUP_ALL,
|
BTRFS_QGROUP_ALL,
|
||||||
|
Loading…
Reference in New Issue
Block a user