/* Returns: The resource group, or NULL if not found  */
struct gfs2_rgrpd* gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk)
/* Returns: The resource group, or NULL if not found  */
struct gfs2_rgrpd* gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk)
{
	struct gfs2_rgrpd *rgd;
	spin_lock(&sdp->sd_rindex_spin);
	list_for_each_entry(rgd, &sdp->sd_rindex_mru_list, rd_list_mru) {
		if (rgrp_contains_block(rgd, blk)) {
			list_move(&rgd->rd_list_mru, &sdp->sd_rindex_mru_list);
			spin_unlock(&sdp->sd_rindex_spin);
			return rgd;
		}
	}
	spin_unlock(&sdp->sd_rindex_spin);
	return NULL;
}