From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@sandeen.net, djwong@kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 1/2] xfs_io: only print the header once when dumping fsmap in csv format
Date: Fri, 02 Jul 2021 19:58:15 -0700 [thread overview]
Message-ID: <162528109507.38807.485600723669552708.stgit@locust> (raw)
In-Reply-To: <162528108960.38807.10502298775223215201.stgit@locust>
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>
---
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),
next prev parent reply other threads:[~2021-07-03 2:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-03 2:58 [PATCHSET 0/2] xfs_io: small fixes to fsmap command Darrick J. Wong
2021-07-03 2:58 ` Darrick J. Wong [this message]
2021-07-05 15:21 ` [PATCH 1/2] xfs_io: only print the header once when dumping fsmap in csv format Christoph Hellwig
2021-07-03 2:58 ` [PATCH 2/2] xfs_io: don't count fsmaps before querying fsmaps Darrick J. Wong
2021-07-05 15:25 ` Christoph Hellwig
2021-07-06 18:30 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2021-07-28 21:16 [PATCHSET 0/2] xfs_io: small fixes to fsmap command Darrick J. Wong
2021-07-28 21:16 ` [PATCH 1/2] xfs_io: only print the header once when dumping fsmap in csv format Darrick J. Wong
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=162528109507.38807.485600723669552708.stgit@locust \
--to=djwong@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox