X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=block%2Fblk-cgroup.c;h=9d359e05fad74d0a2f2a9a64ef3aeeb40bb3a7d6;hb=4e90b688013526340fef9f11ae0184888fd563d1;hp=5bcdfc10c23a6340367c4b9781496a49b5c81efe;hpb=be9e2f775f5a3147205c552534c3abf0f9374a13;p=firefly-linux-kernel-4.4.55.git diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 5bcdfc10c23a..9d359e05fad7 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1127,15 +1127,15 @@ void blkcg_exit_queue(struct request_queue *q) * 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 blkcg_can_attach(struct cgroup_subsys_state *css, - struct cgroup_taskset *tset) +static int blkcg_can_attach(struct cgroup_taskset *tset) { struct task_struct *task; + struct cgroup_subsys_state *dst_css; struct io_context *ioc; int ret = 0; /* task_lock() is needed to avoid races with exit_io_context() */ - cgroup_taskset_for_each(task, tset) { + cgroup_taskset_for_each(task, dst_css, tset) { task_lock(task); ioc = task->io_context; if (ioc && atomic_read(&ioc->nr_tasks) > 1) @@ -1331,10 +1331,8 @@ int blkcg_policy_register(struct blkcg_policy *pol) struct blkcg_policy_data *cpd; cpd = pol->cpd_alloc_fn(GFP_KERNEL); - if (!cpd) { - mutex_unlock(&blkcg_pol_mutex); + if (!cpd) goto err_free_cpds; - } blkcg->cpd[pol->plid] = cpd; cpd->blkcg = blkcg;