/* We cannot support shared io contexts, as we have no mean to support two tasks with the same ioc in two different groups without major rework of the main cic data structures. For now we allow a task to change its cgroup only if it's the only owner of its ioc.  */
static int blkiocg_can_attach(struct cgroup_subsys *subsys, struct cgroup *cgroup, struct task_struct *tsk, bool threadgroup)
/* We cannot support shared io contexts, as we have no mean to support two tasks with the same ioc in two different groups without major rework of the main cic data structures. For now we allow a task to change its cgroup only if it's the only owner of its ioc.  */
static int blkiocg_can_attach(struct cgroup_subsys *subsys, struct cgroup *cgroup, struct task_struct *tsk, bool threadgroup)
{
	struct io_context *ioc;
	int ret = 0;
	task_lock(tsk);
	ioc = tsk->io_context;
	if (ioc && atomic_read(&ioc->nr_tasks) > 1)
		ret = -EINVAL;
	task_unlock(tsk);
	return ret;
}