summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2019-08-28 15:05:52 -0700
committerJens Axboe <axboe@kernel.dk>2019-08-28 21:17:03 -0600
commit86a5bba5c252e90d264c7460e29a0b9e633777e7 (patch)
tree764c165e3a9f51a9496868154e780b0fb4b33adf /block
parentcf09a8ee19ad1f78b4e18cdde9f2a61133efacf5 (diff)
downloadblackbird-op-linux-86a5bba5c252e90d264c7460e29a0b9e633777e7.tar.gz
blackbird-op-linux-86a5bba5c252e90d264c7460e29a0b9e633777e7.zip
blkcg: make ->cpd_init_fn() optional
For policies which can do enough initialization from ->cpd_alloc_fn(), make ->cpd_init_fn() optional. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-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 6a82ca3fb5cf..78ccbdcfe723 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1475,7 +1475,8 @@ int blkcg_policy_register(struct blkcg_policy *pol)
blkcg->cpd[pol->plid] = cpd;
cpd->blkcg = blkcg;
cpd->plid = pol->plid;
- pol->cpd_init_fn(cpd);
+ if (pol->cpd_init_fn)
+ pol->cpd_init_fn(cpd);
}
}
OpenPOWER on IntegriCloud