]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
spaceman: Add table header for -d option spaceman
authorDhruvesh Rathore <adrscube@gmail.com>
Wed, 11 Feb 2015 00:14:24 +0000 (11:14 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 11 Feb 2015 00:14:24 +0000 (11:14 +1100)
The xfs_spaceman utility did not have a a proper title to the content
displayed using -d (debug) option.

Old output:

$ sudo xfs_spaceman -c "freesp -d" /media/xfs
       0        4        1
       0        5        1
       0        6        1
       0        7        1
.....

This patch adds a suitable title header to the output, making it much
more readable to the user.

New output:

$ sudo xfs_spaceman -c "freesp -d" /media/xfs
    agno    agbno      len
       0        4        1
       0        5        1
       0        6        1
       0        7        1
....

Signed-off-by: Dhruvesh Rathore <dhruvesh_r@outlook.com>
Signed-off-by: Amey Ruikar <ameyruikar@yahoo.com>
Signed-off-by: Somdeep Dey <somdeepdey10@gmail.com>
spaceman/freesp.c

index b5b353da203a75055608a9e6910b272a093ca0a7..835c50439521a7a5f1d58e5a2aec122edbd709d3 100644 (file)
@@ -327,6 +327,10 @@ freesp_f(
 
        if (!init(argc, argv))
                return 0;
+
+       if (dumpflag)
+               printf("%8s %8s %8s\n", "agno", "agbno", "len");
+
        for (agno = 0; agno < file->geom.agcount; agno++)  {
                if (inaglist(agno))
                        scan_ag(agno);