/* Advance a list_head iterator. The iterator should be positioned at the start of a css_set  */
static void cgroup_advance_iter(struct cgroup *cgrp, struct cgroup_iter *it)
/* Advance a list_head iterator. The iterator should be positioned at the start of a css_set  */
static void cgroup_advance_iter(struct cgroup *cgrp, struct cgroup_iter *it)
{
	struct list_head *l = it->cg_link;
	struct cg_cgroup_link *link;
	struct css_set *cg;
	do {
		l = l->next;
		if (l == &cgrp->css_sets) {
			it->cg_link = NULL;
			return;
		}
		link = list_entry(l, struct cg_cgroup_link, cgrp_link_list);
		cg = link->cg;
	} while (list_empty(&cg->tasks));
	it->cg_link = l;
	it->task = cg->tasks.next;
}