Replace this homegrown helper with its libxfs equivalent.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
}
/* FIX FOR bug 653709 -- EKN */
- if (!xfs_verify_fsbno(mp, bno)) {
+ if (!libxfs_verify_fsbno(mp, bno)) {
do_warn(
_("block in attribute fork of inode %" PRIu64 " is not valid\n"), ino);
return 1;
return verify_ag_bno(sbp, agno, agbno);
}
-/*
- * return 1 if block number is good, 0 if out of range
- */
-int
-verify_dfsbno(xfs_mount_t *mp,
- xfs_fsblock_t fsbno)
-{
- xfs_agnumber_t agno;
- xfs_agblock_t agbno;
- xfs_sb_t *sbp = &mp->m_sb;;
-
- /* range check ag #, ag block. range-checking offset is pointless */
-
- agno = XFS_FSB_TO_AGNO(mp, fsbno);
- agbno = XFS_FSB_TO_AGBNO(mp, fsbno);
-
- return verify_ag_bno(sbp, agno, agbno) == 0;
-}
-
#define XR_DFSBNORANGE_VALID 0
#define XR_DFSBNORANGE_BADSTART 1
#define XR_DFSBNORANGE_BADEND 2
* btree, we'd do it right here. For now, if there's a
* problem, we'll bail out and presumably clear the inode.
*/
- if (!verify_dfsbno(mp, get_unaligned_be64(&pp[i]))) {
+ if (!libxfs_verify_fsbno(mp, get_unaligned_be64(&pp[i]))) {
do_warn(
_("bad bmap btree ptr 0x%" PRIx64 " in ino %" PRIu64 "\n"),
get_unaligned_be64(&pp[i]), lino);
struct blkmap;
struct prefetch_args;
-int
-verify_dfsbno(xfs_mount_t *mp,
- xfs_fsblock_t fsbno);
-
void
convert_extent(
xfs_bmbt_rec_t *rp,
(irec.br_startoff >= fs_max_file_offset))
goto out_free;
- if (!verify_dfsbno(mp, irec.br_startblock) || !verify_dfsbno(mp,
- irec.br_startblock + irec.br_blockcount - 1))
+ if (!libxfs_verify_fsbno(mp, irec.br_startblock) ||
+ !libxfs_verify_fsbno(mp, irec.br_startblock +
+ irec.br_blockcount - 1))
goto out_free;
if (!args->dirs_only && ((irec.br_startoff +
for (i = 0; i < numrecs; i++) {
dbno = get_unaligned_be64(&pp[i]);
- if (!verify_dfsbno(mp, dbno))
+ if (!libxfs_verify_fsbno(mp, dbno))
return 0;
if (!pf_scan_lbtree(dbno, level, isadir, args, pf_scanfunc_bmap))
return 0;
for (i = 0; i < numrecs; i++) {
dbno = get_unaligned_be64(&pp[i]);
- if (!verify_dfsbno(mp, dbno))
+ if (!libxfs_verify_fsbno(mp, dbno))
break;
if (!pf_scan_lbtree(dbno, level, isadir, args, pf_scanfunc_bmap))
break;
* we'd do it right here. For now, if there's a problem,
* we'll bail out and presumably clear the inode.
*/
- if (!verify_dfsbno(mp, be64_to_cpu(pp[i]))) {
+ if (!libxfs_verify_fsbno(mp, be64_to_cpu(pp[i]))) {
do_warn(
_("bad bmap btree ptr 0x%llx in ino %" PRIu64 "\n"),
(unsigned long long) be64_to_cpu(pp[i]), ino);