From feebd734134ef18357b0281fb6e7c0a516fe13bc Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Sat, 5 Jun 2021 10:07:55 -0700 Subject: [PATCH] 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 --- io/fsmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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), -- 2.47.3