@@ -182,6 +182,7 @@
#define xfs_trans_roll libxfs_trans_roll
#define xfs_verify_agbno libxfs_verify_agbno
+#define xfs_verify_agino libxfs_verify_agino
#define xfs_verify_cksum libxfs_verify_cksum
#define xfs_verify_dir_ino libxfs_verify_dir_ino
#define xfs_verify_fsbno libxfs_verify_fsbno
@@ -1124,7 +1124,7 @@ check_uncertain_aginodes(xfs_mount_t *mp, xfs_agnumber_t agno)
agino = i + irec->ino_startnum;
- if (verify_aginum(mp, agno, agino))
+ if (!libxfs_verify_agino(mp, agno, agino))
continue;
if (nrec != NULL && nrec->ino_startnum <= agino &&
@@ -1133,7 +1133,7 @@ check_uncertain_aginodes(xfs_mount_t *mp, xfs_agnumber_t agno)
continue;
if ((nrec = find_inode_rec(mp, agno, agino)) == NULL)
- if (!verify_aginum(mp, agno, agino))
+ if (libxfs_verify_agino(mp, agno, agino))
if (verify_aginode_chunk(mp, agno,
agino, &start))
got_some = 1;
@@ -1215,7 +1215,7 @@ process_uncertain_aginodes(xfs_mount_t *mp, xfs_agnumber_t agno)
* good tree), bad inode numbers, and inode numbers
* pointing to bogus inodes
*/
- if (verify_aginum(mp, agno, agino))
+ if (!libxfs_verify_agino(mp, agno, agino))
continue;
if (nrec != NULL && nrec->ino_startnum <= agino &&
@@ -152,57 +152,6 @@ clear_dinode(xfs_mount_t *mp, xfs_dinode_t *dino, xfs_ino_t ino_num)
* misc. inode-related utility routines
*/
-/*
- * verify_ag_bno is heavily used. In the common case, it
- * performs just two number of compares
- * Returns 1 for bad ag/bno pair or 0 if it's valid.
- */
-static __inline int
-verify_ag_bno(xfs_sb_t *sbp,
- xfs_agnumber_t agno,
- xfs_agblock_t agbno)
-{
- if (agno < (sbp->sb_agcount - 1))
- return (agbno >= sbp->sb_agblocks);
- if (agno == (sbp->sb_agcount - 1))
- return (agbno >= (sbp->sb_dblocks -
- ((xfs_rfsblock_t)(sbp->sb_agcount - 1) *
- sbp->sb_agblocks)));
- return 1;
-}
-
-/*
- * have a separate routine to ensure that we don't accidentally
- * lose illegally set bits in the agino by turning it into an FSINO
- * to feed to the above routine
- */
-int
-verify_aginum(xfs_mount_t *mp,
- xfs_agnumber_t agno,
- xfs_agino_t agino)
-{
- xfs_agblock_t agbno;
- xfs_sb_t *sbp = &mp->m_sb;;
-
- /* range check ag #, ag block. range-checking offset is pointless */
-
- if (agino == 0 || agino == NULLAGINO)
- return(1);
-
- /*
- * agino's can't be too close to NULLAGINO because the min blocksize
- * is 9 bits and at most 1 bit of that gets used for the inode offset
- * so if the agino gets shifted by the # of offset bits and compared
- * to the legal agbno values, a bogus agino will be too large. there
- * will be extra bits set at the top that shouldn't be set.
- */
- agbno = XFS_AGINO_TO_AGBNO(mp, agino);
- if (agbno == 0)
- return 1;
-
- return verify_ag_bno(sbp, agno, agbno);
-}
-
#define XR_DFSBNORANGE_VALID 0
#define XR_DFSBNORANGE_BADSTART 1
#define XR_DFSBNORANGE_BADEND 2
@@ -68,11 +68,6 @@ verify_uncertain_dinode(xfs_mount_t *mp,
xfs_agnumber_t agno,
xfs_agino_t ino);
-int
-verify_aginum(xfs_mount_t *mp,
- xfs_agnumber_t agno,
- xfs_agino_t agino);
-
int
process_uncertain_aginodes(xfs_mount_t *mp,
xfs_agnumber_t agno);
@@ -1561,7 +1561,7 @@ verify_single_ino_chunk_align(
* (NULLAGINO). if it gets closer, the agino number will be illegal as
* the agbno will be too large.
*/
- if (verify_aginum(mp, agno, ino)) {
+ if (!libxfs_verify_agino(mp, agno, ino)) {
do_warn(
_("bad starting inode # (%" PRIu64 " (0x%x 0x%x)) in %s rec, skipping rec\n"),
lino, agno, ino, inobt_name);
@@ -1569,7 +1569,7 @@ _("bad starting inode # (%" PRIu64 " (0x%x 0x%x)) in %s rec, skipping rec\n"),
return ++suspect;
}
- if (verify_aginum(mp, agno,
+ if (!libxfs_verify_agino(mp, agno,
ino + XFS_INODES_PER_CHUNK - 1)) {
do_warn(
_("bad ending inode # (%" PRIu64 " (0x%x 0x%zx)) in %s rec, skipping rec\n"),