summaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorTejun Heo2015-08-18 23:55:10 +0200
committerJens Axboe2015-08-19 00:49:16 +0200
commit3e41871046bfe0ba7d122a1f14f0c1db2dca0256 (patch)
treef6b33773063f53df1ab0751199a7f6830f6398bf /block/blk-cgroup.c
parentblkcg: restructure blkg_policy_data allocation in blkcg_activate_policy() (diff)
downloadkernel-qcow2-linux-3e41871046bfe0ba7d122a1f14f0c1db2dca0256.tar.gz
kernel-qcow2-linux-3e41871046bfe0ba7d122a1f14f0c1db2dca0256.tar.xz
kernel-qcow2-linux-3e41871046bfe0ba7d122a1f14f0c1db2dca0256.zip
blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn
blkg_create() allows NULL ->pd_init_fn() but blkcg_activate_policy() doesn't. As both in-kernel policies implement ->pd_init_fn, it currently doesn't break anything. Update blkcg_activate_policy() so that its behavior is consistent with blkg_create(). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 9e9b0df339ee..4defbbabc0ff 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1083,7 +1083,8 @@ pd_prealloc:
blkg->pd[pol->plid] = pd;
pd->blkg = blkg;
pd->plid = pol->plid;
- pol->pd_init_fn(blkg);
+ if (pol->pd_init_fn)
+ pol->pd_init_fn(blkg);
}
__set_bit(pol->plid, q->blkcg_pols);