From: Darrick J. Wong Date: Wed, 28 Jul 2021 23:01:23 +0000 (-0400) Subject: xfs_io: only print the header once when dumping fsmap in csv format X-Git-Tag: v5.13.0-rc1~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e264ca71e218fd17ce384bd21d81d1dd10172d39;p=thirdparty%2Fxfsprogs-dev.git xfs_io: only print the header once when dumping fsmap in csv format Only print the column names once when we're dumping fsmap information in csv format. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/io/fsmap.c b/io/fsmap.c index 4b2175957..9f179fa80 100644 --- a/io/fsmap.c +++ b/io/fsmap.c @@ -116,7 +116,8 @@ dump_map_machine( struct fsmap *p; char *fork; - printf(_("EXT,MAJOR,MINOR,PSTART,PEND,OWNER,OSTART,OEND,LENGTH\n")); + if (*nr == 0) + printf(_("EXT,MAJOR,MINOR,PSTART,PEND,OWNER,OSTART,OEND,LENGTH\n")); for (i = 0, p = head->fmh_recs; i < head->fmh_entries; i++, p++) { printf("%llu,%u,%u,%lld,%lld,", i + (*nr), major(p->fmr_device), minor(p->fmr_device),