/* Retrieve the block pointer from the cursor at the given level. This may be an inode btree root or from a buffer.  */
STATIC struct xfs_btree_block* xfs_btree_get_block(struct xfs_btree_cur *cur, int level, struct xfs_buf **bpp)
/* Retrieve the block pointer from the cursor at the given level. This may be an inode btree root or from a buffer.  */
STATIC struct xfs_btree_block* xfs_btree_get_block(struct xfs_btree_cur *cur, int level, struct xfs_buf **bpp)
{
	if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) &&
	    (level == cur->bc_nlevels - 1)) {
		*bpp = NULL;
		return xfs_btree_get_iroot(cur);
	}
	*bpp = cur->bc_bufs[level];
	return XFS_BUF_TO_BLOCK(*bpp);
}