mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-08 00:00:12 +03:00
cmd_fs_usage: Print new reconcile counters
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
7a041ef0c9
commit
73e7388245
@ -379,8 +379,11 @@ static int fs_usage_v1_to_text(struct printbuf *out,
|
|||||||
if (fields & FS_USAGE_btree)
|
if (fields & FS_USAGE_btree)
|
||||||
accounting_types |= BIT(BCH_DISK_ACCOUNTING_btree);
|
accounting_types |= BIT(BCH_DISK_ACCOUNTING_btree);
|
||||||
|
|
||||||
if (fields & FS_USAGE_rebalance_work)
|
if (fields & FS_USAGE_rebalance_work) {
|
||||||
accounting_types |= BIT(BCH_DISK_ACCOUNTING_rebalance_work);
|
accounting_types |= BIT(BCH_DISK_ACCOUNTING_rebalance_work);
|
||||||
|
accounting_types |= BIT(BCH_DISK_ACCOUNTING_reconcile_work);
|
||||||
|
accounting_types |= BIT(BCH_DISK_ACCOUNTING_dev_leaving);
|
||||||
|
}
|
||||||
|
|
||||||
struct bch_ioctl_query_accounting *a =
|
struct bch_ioctl_query_accounting *a =
|
||||||
bchu_fs_accounting(fs, accounting_types);
|
bchu_fs_accounting(fs, accounting_types);
|
||||||
@ -493,6 +496,20 @@ static int fs_usage_v1_to_text(struct printbuf *out,
|
|||||||
prt_units_u64(out, a->v.d[0] << 9);
|
prt_units_u64(out, a->v.d[0] << 9);
|
||||||
prt_newline(out);
|
prt_newline(out);
|
||||||
break;
|
break;
|
||||||
|
case BCH_DISK_ACCOUNTING_reconcile_work:
|
||||||
|
if (new_type) {
|
||||||
|
prt_printf(out, "\nPending rebalance work:\n");
|
||||||
|
printbuf_tabstops_reset(out);
|
||||||
|
printbuf_tabstop_push(out, 16);
|
||||||
|
printbuf_tabstop_push(out, 16);
|
||||||
|
}
|
||||||
|
bch2_prt_reconcile_accounting_type(out, acc_k.reconcile_work.type);
|
||||||
|
prt_char(out, ':');
|
||||||
|
prt_tab(out);
|
||||||
|
prt_units_u64(out, a->v.d[0] << 9);
|
||||||
|
prt_tab_rjust(out);
|
||||||
|
prt_newline(out);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -648,6 +665,9 @@ int cmd_fs_usage(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
args_shift(optind);
|
args_shift(optind);
|
||||||
|
|
||||||
|
if (!fields)
|
||||||
|
fields |= FS_USAGE_rebalance_work;
|
||||||
|
|
||||||
if (!argc) {
|
if (!argc) {
|
||||||
printbuf_reset(&buf);
|
printbuf_reset(&buf);
|
||||||
buf.human_readable_units = human_readable;
|
buf.human_readable_units = human_readable;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user