From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, Dave Chinner <dchinner@redhat.com>
Subject: [PATCH 2/4] xfs_spaceman: remove open-coded per-ag bulkstat
Date: Wed, 25 Sep 2019 14:33:08 -0700 [thread overview]
Message-ID: <156944718836.297551.759888543573443808.stgit@magnolia> (raw)
In-Reply-To: <156944717403.297551.9871784842549394192.stgit@magnolia>
From: Darrick J. Wong <darrick.wong@oracle.com>
Now that xfrog_bulkstat supports per-AG bulkstat, we can get rid of the
open coded one in spaceman.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
---
spaceman/health.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/spaceman/health.c b/spaceman/health.c
index b195a229..8fd985a2 100644
--- a/spaceman/health.c
+++ b/spaceman/health.c
@@ -268,30 +268,24 @@ report_bulkstat_health(
{
struct xfs_bulkstat_req *breq;
char descr[256];
- uint64_t startino = 0;
- uint64_t lastino = -1ULL;
uint32_t i;
int error;
- if (agno != NULLAGNUMBER) {
- startino = cvt_agino_to_ino(&file->xfd, agno, 0);
- lastino = cvt_agino_to_ino(&file->xfd, agno + 1, 0) - 1;
- }
-
- breq = xfrog_bulkstat_alloc_req(BULKSTAT_NR, startino);
+ breq = xfrog_bulkstat_alloc_req(BULKSTAT_NR, 0);
if (!breq) {
perror("bulk alloc req");
exitcode = 1;
return 1;
}
+ if (agno != NULLAGNUMBER)
+ xfrog_bulkstat_set_ag(breq, agno);
+
do {
error = xfrog_bulkstat(&file->xfd, breq);
if (error)
break;
for (i = 0; i < breq->hdr.ocount; i++) {
- if (breq->bulkstat[i].bs_ino > lastino)
- goto out;
snprintf(descr, sizeof(descr) - 1, _("inode %"PRIu64),
breq->bulkstat[i].bs_ino);
report_sick(descr, inode_flags,
@@ -304,7 +298,7 @@ report_bulkstat_health(
errno = error;
perror("bulkstat");
}
-out:
+
free(breq);
return error;
}
next prev parent reply other threads:[~2019-09-25 21:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 21:32 [PATCH 0/4] xfsprogs: bulkstat v5 Darrick J. Wong
2019-09-25 21:33 ` [PATCH 1/4] xfs_io: add a bulkstat command Darrick J. Wong
2019-09-26 22:40 ` Eric Sandeen
2019-09-26 22:46 ` Eric Sandeen
2019-09-27 4:18 ` Darrick J. Wong
2019-09-30 20:02 ` Eric Sandeen
2019-09-30 20:15 ` Darrick J. Wong
2019-10-07 19:13 ` Eric Sandeen
2019-09-27 20:15 ` [PATCH v2 " Darrick J. Wong
2019-09-30 20:15 ` Eric Sandeen
2019-09-25 21:33 ` Darrick J. Wong [this message]
2019-09-25 21:33 ` [PATCH 3/4] xfs_scrub: convert to per-ag inode bulkstat operations Darrick J. Wong
2019-09-25 21:33 ` [PATCH 4/4] xfs_scrub: batch inumbers calls during fscounters calculation Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2019-09-06 3:35 [PATCH 0/4] xfsprogs: bulkstat v5 Darrick J. Wong
2019-09-06 3:35 ` [PATCH 2/4] xfs_spaceman: remove open-coded per-ag bulkstat Darrick J. Wong
2019-09-12 23:52 ` Dave Chinner
2019-08-26 21:27 [PATCH 0/4] xfsprogs: bulkstat v5 Darrick J. Wong
2019-08-26 21:28 ` [PATCH 2/4] xfs_spaceman: remove open-coded per-ag bulkstat 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=156944718836.297551.759888543573443808.stgit@magnolia \
--to=darrick.wong@oracle.com \
--cc=dchinner@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).