Path: csiph.com!aioe.org!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod From: Tejun Heo Newsgroups: linux.kernel Subject: [PATCH 3/7] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn Date: Wed, 24 Jun 2015 04:50:01 +0200 Message-ID: References: X-Original-To: axboe@kernel.dk Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=omlVTWKzWCrH8anprEL85RCqpC2oYK2YLJnRCH/0Sx0=; b=XQVMgxVVyz0Nz4wTEryWY1RPPDb3niLwj4AcdeZ1fbH3F37n7ZvSb9TlVabCgeznux 8xS+yJHBM0JwijYEPgBaDOlXzrG0nGug6WreoCaE22D4PegAJ30yhqTCaOzKEO8SShMu PQBKzh6MzTenrcWhyqQrFMIjBT1gP3765yWl3WIPUaw9Zn2apQjxaazKpxDWHUk2NYjT cSeieyZ8ahZspXg33GEeW6WrgRIH4820PTYhGzqiRz8O8LBnJFyQRlhY8xXgTFXIipn9 7zp2zjtvv3ODZmiLSwYy/4vel+cXTtlCPLu3zRu7E/b8FWXRec89p2GI/Z1lVjAqWlxN XgYg== X-Received: by 10.55.31.164 with SMTP id n36mr79977249qkh.76.1435113859881; Tue, 23 Jun 2015 19:44:19 -0700 (PDT) X-Mailer: git-send-email 2.4.3 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 33 Organization: linux.* mail to news gateway X-Original-Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, vgoyal@redhat.com, avanzini.arianna@gmail.com, kernel-team@fb.com, Tejun Heo X-Original-Date: Tue, 23 Jun 2015 22:44:09 -0400 X-Original-Message-ID: <1435113853-12053-4-git-send-email-tj@kernel.org> X-Original-References: <1435113853-12053-1-git-send-email-tj@kernel.org> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: aioe.org linux.kernel:1171035 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 -- 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/