From: Tejun Heo Date: Tue, 14 May 2013 20:52:31 +0000 (-0700) Subject: blkcg: invoke blkcg_policy->pd_init() after parent is linked X-Git-Tag: v3.11-rc1~21^2~32 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db61367038dcd222476881cb09fd54661b3cd508;p=pandora-kernel.git blkcg: invoke blkcg_policy->pd_init() after parent is linked Currently, when creating a new blkcg_gq, each policy's pd_init_fn() is invoked in blkg_alloc() before the parent is linked. This makes it difficult for policies to perform initializations which are dependent on the parent. This patch moves pd_init_fn() invocations to blkg_create() after the parent blkg is linked where the new blkg is fully initialized. As this means that blkg_free() can't assume that pd's are initialized, pd_exit_fn() invocations are moved to __blkg_release(). This guarantees that pd_exit_fn() is also invoked with fully initialized blkgs with valid parent pointers. This will help implementing hierarchy support in blk-throttle. Signed-off-by: Tejun Heo Acked-by: Vivek Goyal --- Reading git-diff-tree failed