Return the bp->b_error from libxfs_readbuf_verify instead of making
callers check it.
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>
#endif /* XFS_BUF_TRACING */
-extern void libxfs_readbuf_verify(struct xfs_buf *bp,
- const struct xfs_buf_ops *ops);
+int libxfs_readbuf_verify(struct xfs_buf *bp, const struct xfs_buf_ops *ops);
struct xfs_buf *libxfs_getsb(struct xfs_mount *mp);
extern void libxfs_bcache_purge(void);
extern void libxfs_bcache_free(void);
return error;
}
-void
-libxfs_readbuf_verify(struct xfs_buf *bp, const struct xfs_buf_ops *ops)
+int
+libxfs_readbuf_verify(
+ struct xfs_buf *bp,
+ const struct xfs_buf_ops *ops)
{
if (!ops)
- return;
+ return bp->b_error;
+
bp->b_ops = ops;
bp->b_ops->verify_read(bp);
bp->b_flags &= ~LIBXFS_B_UNCHECKED;
+ return bp->b_error;
}
static struct xfs_buf *
int icnt = 0;
int hasdir = 0;
int isadir;
+ int error;
- libxfs_readbuf_verify(bp, &xfs_inode_buf_ops);
- if (bp->b_error)
+ error = -libxfs_readbuf_verify(bp, &xfs_inode_buf_ops);
+ if (error)
return;
for (icnt = 0; icnt < (bp->b_bcount >> mp->m_sb.sb_inodelog); icnt++) {