Commit 3e418710 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe

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: default avatarTejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 4c55f4f9
...@@ -1083,6 +1083,7 @@ int blkcg_activate_policy(struct request_queue *q, ...@@ -1083,6 +1083,7 @@ int blkcg_activate_policy(struct request_queue *q,
blkg->pd[pol->plid] = pd; blkg->pd[pol->plid] = pd;
pd->blkg = blkg; pd->blkg = blkg;
pd->plid = pol->plid; pd->plid = pol->plid;
if (pol->pd_init_fn)
pol->pd_init_fn(blkg); pol->pd_init_fn(blkg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment