Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1182206

[PATCH 05/11] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 05/11] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn
Date 2015-07-11 20:10 +0200
Message-ID <pL7nP-6mH-9@gated-at.bofh.it> (permalink)
References <pL7nP-6mH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 block/blk-cgroup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 5dbbacd..b558705 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1079,7 +1079,8 @@ int blkcg_activate_policy(struct request_queue *q,
 		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);
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHSET v3 block/for-4.3] blkcg: blkcg policy methods and data handling cleanup Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 04/11] blkcg: restructure blkg_policy_data allocation in blkcg_activate_policy() Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 05/11] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 08/11] blk-throttle: clean up blkg_policy_data alloc/init/exit/free methods Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 09/11] blkcg: make blkcg_policy methods take a pointer to blkcg_policy_data Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 11/11] blkcg: replace blkcg_policy->cpd_size with ->cpd_alloc/free_fn() methods Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 10/11] blkcg: cosmetic updates about blkcg_policy_data Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 03/11] blkcg: remove unnecessary blkcg_root handling from css_alloc/free paths Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 01/11] blkcg: remove unnecessary request_list->blkg NULL test in blk_put_rl() Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200
  [PATCH 07/11] blk-throttle: remove asynchrnous percpu stats allocation mechanism Tejun Heo <tj@kernel.org> - 2015-07-11 20:10 +0200

csiph-web