mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-18 10:46:53 +00:00
btrfs-progs: fi usage: print device id column in the tabular output<F2>
Example output: Data Metadata System Id Path single RAID1 RAID1 Unallocated 1 /dev/sdc2 44.94GiB 7.93GiB 32.00MiB 1.00GiB 2 /dev/sde1 44.94GiB 7.93GiB 32.00MiB 1.00GiB ======== ======== ======== =========== Total 89.88GiB 7.93GiB 32.00MiB 2.00GiB Used 74.28GiB 4.44GiB 20.00KiB Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
258a0e8812
commit
952251481e
@ -627,9 +627,9 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode,
|
|||||||
int spaceinfos_col;
|
int spaceinfos_col;
|
||||||
const int vhdr_skip = 3; /* amount of vertical header space */
|
const int vhdr_skip = 3; /* amount of vertical header space */
|
||||||
|
|
||||||
/* path, unallocated */
|
/* id, path, unallocated */
|
||||||
ncols = 2;
|
ncols = 3;
|
||||||
spaceinfos_col = 1;
|
spaceinfos_col = 2;
|
||||||
/* Properly count the real space infos */
|
/* Properly count the real space infos */
|
||||||
for (i = 0; i < sargs->total_spaces; i++) {
|
for (i = 0; i < sargs->total_spaces; i++) {
|
||||||
if (sargs->spaces[i].flags & BTRFS_SPACE_INFO_GLOBAL_RSV)
|
if (sargs->spaces[i].flags & BTRFS_SPACE_INFO_GLOBAL_RSV)
|
||||||
@ -666,7 +666,8 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode,
|
|||||||
}
|
}
|
||||||
unallocated_col = col;
|
unallocated_col = col;
|
||||||
|
|
||||||
table_printf(matrix, 0, 1, "<Path");
|
table_printf(matrix, 0, 1, "<Id");
|
||||||
|
table_printf(matrix, 1, 1, "<Path");
|
||||||
table_printf(matrix, unallocated_col, 1, "<Unallocated");
|
table_printf(matrix, unallocated_col, 1, "<Unallocated");
|
||||||
|
|
||||||
/* body */
|
/* body */
|
||||||
@ -682,7 +683,9 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode,
|
|||||||
else
|
else
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
table_printf(matrix, 0, vhdr_skip + i, "<%s",
|
table_printf(matrix, 0, vhdr_skip + i, ">%llu",
|
||||||
|
device_info_ptr[i].devid);
|
||||||
|
table_printf(matrix, 1, vhdr_skip + i, "<%s",
|
||||||
device_info_ptr[i].path);
|
device_info_ptr[i].path);
|
||||||
|
|
||||||
for (col = spaceinfos_col, k = 0; k < sargs->total_spaces; k++) {
|
for (col = spaceinfos_col, k = 0; k < sargs->total_spaces; k++) {
|
||||||
@ -732,7 +735,7 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode,
|
|||||||
table_printf(matrix, col, vhdr_skip + device_info_count, "=");
|
table_printf(matrix, col, vhdr_skip + device_info_count, "=");
|
||||||
|
|
||||||
/* footer */
|
/* footer */
|
||||||
table_printf(matrix, 0, vhdr_skip + device_info_count + 1, "<Total");
|
table_printf(matrix, 1, vhdr_skip + device_info_count + 1, "<Total");
|
||||||
for (i = 0, col = spaceinfos_col; i < sargs->total_spaces; i++) {
|
for (i = 0, col = spaceinfos_col; i < sargs->total_spaces; i++) {
|
||||||
if (sargs->spaces[i].flags & BTRFS_SPACE_INFO_GLOBAL_RSV)
|
if (sargs->spaces[i].flags & BTRFS_SPACE_INFO_GLOBAL_RSV)
|
||||||
continue;
|
continue;
|
||||||
@ -745,7 +748,7 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode,
|
|||||||
table_printf(matrix, unallocated_col, vhdr_skip + device_info_count + 1,
|
table_printf(matrix, unallocated_col, vhdr_skip + device_info_count + 1,
|
||||||
">%s", pretty_size_mode(total_unused, unit_mode));
|
">%s", pretty_size_mode(total_unused, unit_mode));
|
||||||
|
|
||||||
table_printf(matrix, 0, vhdr_skip + device_info_count + 2, "<Used");
|
table_printf(matrix, 1, vhdr_skip + device_info_count + 2, "<Used");
|
||||||
for (i = 0, col = spaceinfos_col; i < sargs->total_spaces; i++) {
|
for (i = 0, col = spaceinfos_col; i < sargs->total_spaces; i++) {
|
||||||
if (sargs->spaces[i].flags & BTRFS_SPACE_INFO_GLOBAL_RSV)
|
if (sargs->spaces[i].flags & BTRFS_SPACE_INFO_GLOBAL_RSV)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user