From: Barry Naujok Date: Mon, 16 Jul 2007 03:57:52 +0000 (+0000) Subject: Always show flags column with xfs_bmap -vp options X-Git-Tag: v2.10.0~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66b573401779074ed639f3610b80ef6dfc5481b6;p=thirdparty%2Fxfsprogs-dev.git Always show flags column with xfs_bmap -vp options Merge of master-melb:xfs-cmds:29140a by kenmcd. Always show flags column with xfs_bmap -vp options --- diff --git a/io/bmap.c b/io/bmap.c index cdb4307c2..37632e3cb 100644 --- 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);