From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 6/7] xfs: remove return value from xchk_ag_btcur_init
Date: Tue, 02 Mar 2021 14:29:10 -0800 [thread overview]
Message-ID: <161472415044.3421582.2179320230294749858.stgit@magnolia> (raw)
In-Reply-To: <161472411627.3421582.2040330025988154363.stgit@magnolia>
From: Darrick J. Wong <djwong@kernel.org>
Functions called by this function cannot fail, so get rid of the return
and error checking.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
| 15 +++------------
fs/xfs/scrub/common.c | 7 +++----
fs/xfs/scrub/common.h | 2 +-
3 files changed, 7 insertions(+), 17 deletions(-)
--git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index afe60a9ca93f..749faa17f8e2 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -477,16 +477,13 @@ xchk_agf_xref(
{
struct xfs_mount *mp = sc->mp;
xfs_agblock_t agbno;
- int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
agbno = XFS_AGF_BLOCK(mp);
- error = xchk_ag_btcur_init(sc, &sc->sa);
- if (error)
- return;
+ xchk_ag_btcur_init(sc, &sc->sa);
xchk_xref_is_used_space(sc, agbno, 1);
xchk_agf_xref_freeblks(sc);
@@ -660,16 +657,13 @@ xchk_agfl_xref(
{
struct xfs_mount *mp = sc->mp;
xfs_agblock_t agbno;
- int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
agbno = XFS_AGFL_BLOCK(mp);
- error = xchk_ag_btcur_init(sc, &sc->sa);
- if (error)
- return;
+ xchk_ag_btcur_init(sc, &sc->sa);
xchk_xref_is_used_space(sc, agbno, 1);
xchk_xref_is_not_inode_chunk(sc, agbno, 1);
@@ -813,16 +807,13 @@ xchk_agi_xref(
{
struct xfs_mount *mp = sc->mp;
xfs_agblock_t agbno;
- int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
agbno = XFS_AGI_BLOCK(mp);
- error = xchk_ag_btcur_init(sc, &sc->sa);
- if (error)
- return;
+ xchk_ag_btcur_init(sc, &sc->sa);
xchk_xref_is_used_space(sc, agbno, 1);
xchk_xref_is_not_inode_chunk(sc, agbno, 1);
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 45c5bf37daaa..da60e7d1f895 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -452,7 +452,7 @@ xchk_ag_btcur_free(
}
/* Initialize all the btree cursors for an AG. */
-int
+void
xchk_ag_btcur_init(
struct xfs_scrub *sc,
struct xchk_ag *sa)
@@ -502,8 +502,6 @@ xchk_ag_btcur_init(
sa->refc_cur = xfs_refcountbt_init_cursor(mp, sc->tp,
sa->agf_bp, agno);
}
-
- return 0;
}
/* Release the AG header context and btree cursors. */
@@ -551,7 +549,8 @@ xchk_ag_init(
if (error)
return error;
- return xchk_ag_btcur_init(sc, sa);
+ xchk_ag_btcur_init(sc, sa);
+ return 0;
}
/*
diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
index bf94b2db0b96..5e2c6f693503 100644
--- a/fs/xfs/scrub/common.h
+++ b/fs/xfs/scrub/common.h
@@ -122,7 +122,7 @@ void xchk_perag_get(struct xfs_mount *mp, struct xchk_ag *sa);
int xchk_ag_read_headers(struct xfs_scrub *sc, xfs_agnumber_t agno,
struct xchk_ag *sa);
void xchk_ag_btcur_free(struct xchk_ag *sa);
-int xchk_ag_btcur_init(struct xfs_scrub *sc, struct xchk_ag *sa);
+void xchk_ag_btcur_init(struct xfs_scrub *sc, struct xchk_ag *sa);
int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
const struct xfs_owner_info *oinfo, xfs_filblks_t *blocks);
next prev parent reply other threads:[~2021-03-03 3:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 22:28 [PATCHSET 0/7] xfs: small fixes and cleanups Darrick J. Wong
2021-03-02 22:28 ` [PATCH 1/7] xfs: fix uninitialized variables in xrep_calc_ag_resblks Darrick J. Wong
2021-03-05 8:23 ` Christoph Hellwig
2021-03-05 17:49 ` Darrick J. Wong
2021-03-06 7:15 ` Christoph Hellwig
2021-03-02 22:28 ` [PATCH 2/7] xfs: fix dquot scrub loop cancellation Darrick J. Wong
2021-03-05 8:24 ` Christoph Hellwig
2021-03-02 22:28 ` [PATCH 3/7] xfs: bail out of scrub immediately if scan incomplete Darrick J. Wong
2021-03-05 8:25 ` Christoph Hellwig
2021-03-02 22:28 ` [PATCH 4/7] xfs: mark a data structure sick if there are cross-referencing errors Darrick J. Wong
2021-03-05 8:26 ` Christoph Hellwig
2021-03-02 22:29 ` [PATCH 5/7] xfs: set the scrub AG number in xchk_ag_read_headers Darrick J. Wong
2021-03-05 8:27 ` Christoph Hellwig
2021-03-02 22:29 ` Darrick J. Wong [this message]
2021-03-05 8:28 ` [PATCH 6/7] xfs: remove return value from xchk_ag_btcur_init Christoph Hellwig
2021-03-02 22:29 ` [PATCH 7/7] xfs: validate ag btree levels using the precomputed values Darrick J. Wong
2021-03-05 8:29 ` 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=161472415044.3421582.2179320230294749858.stgit@magnolia \
--to=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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).