/* gfs2_rgrp_bh_put - Release RG bitmaps read in with gfs2_rgrp_bh_get() @rgd: the struct gfs2_rgrpd describing the RG to read in  */
void gfs2_rgrp_bh_put(struct gfs2_rgrpd *rgd)
/* gfs2_rgrp_bh_put - Release RG bitmaps read in with gfs2_rgrp_bh_get() @rgd: the struct gfs2_rgrpd describing the RG to read in  */
void gfs2_rgrp_bh_put(struct gfs2_rgrpd *rgd)
{
	struct gfs2_sbd *sdp = rgd->rd_sbd;
	int x, length = rgd->rd_length;
	spin_lock(&sdp->sd_rindex_spin);
	gfs2_assert_warn(rgd->rd_sbd, rgd->rd_bh_count);
	if (--rgd->rd_bh_count) {
		spin_unlock(&sdp->sd_rindex_spin);
		return;
	}
	for (x = 0; x < length; x++) {
		struct gfs2_bitmap *bi = rgd->rd_bits + x;
		kfree(bi->bi_clone);
		bi->bi_clone = NULL;
		brelse(bi->bi_bh);
		bi->bi_bh = NULL;
	}
	spin_unlock(&sdp->sd_rindex_spin);
}