/* Returns: 1 on success (it fits), 0 on failure (it doesn't fit)  */
static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al)
/* Returns: 1 on success (it fits), 0 on failure (it doesn't fit)  */
static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al)
{
	struct gfs2_sbd *sdp = rgd->rd_sbd;
	int ret = 0;
	if (rgd->rd_flags & (GFS2_RGF_NOALLOC | GFS2_RDF_ERROR))
		return 0;
	spin_lock(&sdp->sd_rindex_spin);
	if (rgd->rd_free_clone >= al->al_requested) {
		al->al_rgd = rgd;
		ret = 1;
	}
	spin_unlock(&sdp->sd_rindex_spin);
	return ret;
}