All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@sandeen.net, djwong@kernel.org
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: [PATCH 1/2] xfs_io: only print the header once when dumping fsmap in csv format
Date: Wed, 28 Jul 2021 14:16:13 -0700	[thread overview]
Message-ID: <162750697323.45811.16662373563564383023.stgit@magnolia> (raw)
In-Reply-To: <162750696777.45811.13113252405327690016.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

Only print the column names once when we're dumping fsmap information in
csv format.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 io/fsmap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/io/fsmap.c b/io/fsmap.c
index 4b217595..9f179fa8 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),


  reply	other threads:[~2021-07-28 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 21:16 [PATCHSET 0/2] xfs_io: small fixes to fsmap command Darrick J. Wong
2021-07-28 21:16 ` Darrick J. Wong [this message]
2021-07-28 21:16 ` [PATCH 2/2] xfs_io: don't count fsmaps before querying fsmaps Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2021-07-03  2:58 [PATCHSET 0/2] xfs_io: small fixes to fsmap command Darrick J. Wong
2021-07-03  2:58 ` [PATCH 1/2] xfs_io: only print the header once when dumping fsmap in csv format Darrick J. Wong
2021-07-05 15:21   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=162750697323.45811.16662373563564383023.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.