From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933687AbbFXCot (ORCPT ); Tue, 23 Jun 2015 22:44:49 -0400 Received: from mail-qc0-f182.google.com ([209.85.216.182]:36836 "EHLO mail-qc0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753649AbbFXCoU (ORCPT ); Tue, 23 Jun 2015 22:44:20 -0400 From: Tejun Heo To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, vgoyal@redhat.com, avanzini.arianna@gmail.com, kernel-team@fb.com, Tejun Heo Subject: [PATCH 3/7] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn Date: Tue, 23 Jun 2015 22:44:09 -0400 Message-Id: <1435113853-12053-4-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1435113853-12053-1-git-send-email-tj@kernel.org> References: <1435113853-12053-1-git-send-email-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Vivek Goyal --- 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 898f560..617a586 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1045,7 +1045,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); spin_unlock(&blkg->blkcg->lock); } -- 2.4.3