Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758242AbbGGPyI (ORCPT ); Tue, 7 Jul 2015 11:54:08 -0400 Received: from mail-yk0-f169.google.com ([209.85.160.169]:33216 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757943AbbGGPvm (ORCPT ); Tue, 7 Jul 2015 11:51:42 -0400 From: Tejun Heo To: axboe@kernel.dk Cc: jack@suse.cz, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, kernel-team@fb.com, vgoyal@redhat.com, avanzini.arianna@gmail.com, Tejun Heo Subject: [PATCH 3/7] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn Date: Tue, 7 Jul 2015 11:51:29 -0400 Message-Id: <1436284293-4666-4-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1436284293-4666-1-git-send-email-tj@kernel.org> References: <1436284293-4666-1-git-send-email-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1068 Lines: 33 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 73209a8..e16d1dc 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1112,7 +1112,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 -- 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/