Commit c81a01a7 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: remove the which variable in xchk_iallocbt

The which variable that holds a btree number is passed to two functions
that ignore it and used in a single check that can check the sm_type
as well.  Remove it to unclutter the code.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent 4bfb028a
...@@ -649,8 +649,7 @@ xchk_iallocbt_rec( ...@@ -649,8 +649,7 @@ xchk_iallocbt_rec(
*/ */
STATIC void STATIC void
xchk_iallocbt_xref_rmap_btreeblks( xchk_iallocbt_xref_rmap_btreeblks(
struct xfs_scrub *sc, struct xfs_scrub *sc)
int which)
{ {
xfs_filblks_t blocks; xfs_filblks_t blocks;
xfs_extlen_t inobt_blocks = 0; xfs_extlen_t inobt_blocks = 0;
...@@ -688,7 +687,6 @@ xchk_iallocbt_xref_rmap_btreeblks( ...@@ -688,7 +687,6 @@ xchk_iallocbt_xref_rmap_btreeblks(
STATIC void STATIC void
xchk_iallocbt_xref_rmap_inodes( xchk_iallocbt_xref_rmap_inodes(
struct xfs_scrub *sc, struct xfs_scrub *sc,
int which,
unsigned long long inodes) unsigned long long inodes)
{ {
xfs_filblks_t blocks; xfs_filblks_t blocks;
...@@ -719,17 +717,14 @@ xchk_iallocbt( ...@@ -719,17 +717,14 @@ xchk_iallocbt(
.next_startino = NULLAGINO, .next_startino = NULLAGINO,
.next_cluster_ino = NULLAGINO, .next_cluster_ino = NULLAGINO,
}; };
xfs_btnum_t which;
int error; int error;
switch (sc->sm->sm_type) { switch (sc->sm->sm_type) {
case XFS_SCRUB_TYPE_INOBT: case XFS_SCRUB_TYPE_INOBT:
cur = sc->sa.ino_cur; cur = sc->sa.ino_cur;
which = XFS_BTNUM_INO;
break; break;
case XFS_SCRUB_TYPE_FINOBT: case XFS_SCRUB_TYPE_FINOBT:
cur = sc->sa.fino_cur; cur = sc->sa.fino_cur;
which = XFS_BTNUM_FINO;
break; break;
default: default:
ASSERT(0); ASSERT(0);
...@@ -741,7 +736,7 @@ xchk_iallocbt( ...@@ -741,7 +736,7 @@ xchk_iallocbt(
if (error) if (error)
return error; return error;
xchk_iallocbt_xref_rmap_btreeblks(sc, which); xchk_iallocbt_xref_rmap_btreeblks(sc);
/* /*
* If we're scrubbing the inode btree, inode_blocks is the number of * If we're scrubbing the inode btree, inode_blocks is the number of
...@@ -750,9 +745,8 @@ xchk_iallocbt( ...@@ -750,9 +745,8 @@ xchk_iallocbt(
* knows about. We can't do this for the finobt since it only points * knows about. We can't do this for the finobt since it only points
* to inode chunks with free inodes. * to inode chunks with free inodes.
*/ */
if (which == XFS_BTNUM_INO) if (sc->sm->sm_type == XFS_SCRUB_TYPE_INOBT)
xchk_iallocbt_xref_rmap_inodes(sc, which, iabt.inodes); xchk_iallocbt_xref_rmap_inodes(sc, iabt.inodes);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment