/* If the reservation window is outside the goal allocation group, return 0; grp_goal (given goal block) could be -1, which means no specific goal block. In this case, always return 1. If the goal block is within the reservation window, return 1; otherwise, return 0;  */
static int goal_in_my_reservation(struct ext2_reserve_window *rsv, ext2_grpblk_t grp_goal, unsigned int group, struct super_block *sb)
/* If the reservation window is outside the goal allocation group, return 0; grp_goal (given goal block) could be -1, which means no specific goal block. In this case, always return 1. If the goal block is within the reservation window, return 1; otherwise, return 0;  */
static int goal_in_my_reservation(struct ext2_reserve_window *rsv, ext2_grpblk_t grp_goal, unsigned int group, struct super_block *sb)
{
	ext2_fsblk_t group_first_block, group_last_block;
	group_first_block = ext2_group_first_block_no(sb, group);
	group_last_block = group_first_block + EXT2_BLOCKS_PER_GROUP(sb) - 1;
	if ((rsv->_rsv_start > group_last_block) ||
	    (rsv->_rsv_end < group_first_block))
		return 0;
	if ((grp_goal >= 0) && ((grp_goal + group_first_block < rsv->_rsv_start)
		|| (grp_goal + group_first_block > rsv->_rsv_end)))
		return 0;
	return 1;
}