/* Get a buffer for the bitmap or summary file block specified. The buffer is returned read and locked.  */
STATIC int xfs_rtbuf_get(xfs_mount_t *mp, xfs_trans_t *tp, xfs_rtblock_t block, int issum, xfs_buf_t **bpp)
/* Get a buffer for the bitmap or summary file block specified. The buffer is returned read and locked.  */
STATIC int xfs_rtbuf_get(xfs_mount_t *mp, xfs_trans_t *tp, xfs_rtblock_t block, int issum, xfs_buf_t **bpp)
{
	xfs_buf_t	*bp;
	xfs_daddr_t	d;
	int		error;
	xfs_fsblock_t	fsb;
	xfs_inode_t	*ip;
	ip = issum ? mp->m_rsumip : mp->m_rbmip;
	error = xfs_bmapi_single(tp, ip, XFS_DATA_FORK, &fsb, block);
	if (error) {
		return error;
	}
	ASSERT(fsb != NULLFSBLOCK);
	d = XFS_FSB_TO_DADDR(mp, fsb);
	error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
				   mp->m_bsize, 0, &bp);
	if (error) {
		return error;
	}
	ASSERT(bp && !XFS_BUF_GETERROR(bp));
	*bpp = bp;
	return 0;
}