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


Groups > linux.kernel > #1171035

[PATCH 3/7] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn

Path csiph.com!aioe.org!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Tejun Heo <tj@kernel.org>
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 <pEIVb-554-11@gated-at.bofh.it> (permalink)
References <pEIVb-554-13@gated-at.bofh.it>
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 <linux-kernel.vger.kernel.org>
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 <tj@kernel.org>
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

Show key headers only | 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 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/

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


Thread

[PATCH 3/7] blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn Tejun Heo <tj@kernel.org> - 2015-06-24 04:50 +0200

csiph-web