/* returns 0 if blkio_group was still on cgroup list. Otherwise returns 1 indicating that blk_group was unhashed by the time we got to it.  */
int blkiocg_del_blkio_group(struct blkio_group *blkg)
/* returns 0 if blkio_group was still on cgroup list. Otherwise returns 1 indicating that blk_group was unhashed by the time we got to it.  */
int blkiocg_del_blkio_group(struct blkio_group *blkg)
{
	struct blkio_cgroup *blkcg;
	unsigned long flags;
	struct cgroup_subsys_state *css;
	int ret = 1;
	rcu_read_lock();
	css = css_lookup(&blkio_subsys, blkg->blkcg_id);
	if (!css)
		goto out;
	blkcg = container_of(css, struct blkio_cgroup, css);
	spin_lock_irqsave(&blkcg->lock, flags);
	if (!hlist_unhashed(&blkg->blkcg_node)) {
		__blkiocg_del_blkio_group(blkg);
		ret = 0;
	}
	spin_unlock_irqrestore(&blkcg->lock, flags);
out:
	rcu_read_unlock();
	return ret;
}