]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Always show flags column with xfs_bmap -vp options
authorBarry Naujok <bnaujok@sgi.com>
Mon, 16 Jul 2007 03:57:52 +0000 (03:57 +0000)
committerBarry Naujok <bnaujok@sgi.com>
Mon, 16 Jul 2007 03:57:52 +0000 (03:57 +0000)
Merge of master-melb:xfs-cmds:29140a by kenmcd.

  Always show flags column with xfs_bmap -vp options

io/bmap.c

index cdb4307c25ac7109872bd38c6cb6e675f0a2dddd..37632e3cb0df351a03392342d31240fe90e09bd7 100644 (file)
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -74,6 +74,7 @@ bmap_f(
        int                     aflag = 0;
        int                     lflag = 0;
        int                     nflag = 0;
+       int                     pflag = 0;
        int                     vflag = 0;
        int                     is_rt = 0;
        int                     bmv_iflags = 0; /* flags for XFS_IOC_GETBMAPX */
@@ -99,6 +100,7 @@ bmap_f(
                        break;
                case 'p':
                /* report unwritten preallocated blocks */
+                       pflag = 1;
                        bmv_iflags |= BMV_IF_PREALLOC;
                        break;
                case 'v':       /* Verbose output */
@@ -289,7 +291,7 @@ bmap_f(
                        sunit = (fsgeo.sunit * fsgeo.blocksize) / BBSIZE;
                        swidth = (fsgeo.swidth * fsgeo.blocksize) / BBSIZE;
                }
-               flg = sunit;
+               flg = sunit | pflag;
 
                /*
                 * Go through the extents and figure out the width
@@ -397,14 +399,14 @@ bmap_f(
                                        printf("  ");
                                printf(" %*lld", tot_w,
                                        (long long)map[i+1].bmv_length);
-                               if (flg == FLG_NULL) {
+                               if (flg == FLG_NULL && !pflag) {
                                        printf("\n");
                                } else {
                                        printf(" %-*.*o\n", NFLG, NFLG, flg);
                                }
                        }
                }
-               if (flg && vflag > 1) {
+               if ((flg || pflag) && vflag > 1) {
                        printf(_(" FLAG Values:\n"));
                        printf(_("    %*.*o Unwritten preallocated extent\n"),
                                NFLG+1, NFLG+1, FLG_PRE);