Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp405708ybi; Thu, 13 Jun 2019 18:57:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuaw0BVXo+HkSt2SY0gQ4XzFwUVHgdmAeXakPNAQ1NQ9ZZPOf4lGwRhsy93TBpHfnvDIRO X-Received: by 2002:a17:90a:9289:: with SMTP id n9mr8584742pjo.35.1560477423410; Thu, 13 Jun 2019 18:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560477423; cv=none; d=google.com; s=arc-20160816; b=R1Ca1byysA03BWCqp+rMPIzoN7Ak9kaxEUkZM2fZzFuBULV6qECibI0z0IE8OeJZWQ ihthYoScDWTZDRnwDlc26nABVcl11MrXL0Sdf9Dx+/RqHa2Fkl+8wexDHaSIAG28+niO qNeR4V8Kqc499KtldyJeQ/GTMe20f093KJzRCITxAmkMVYQFQGx40CSwhDMX6FcTXPCt bbbesH8xEzVlboIgFr6MT6L5mtRRQrWU2txPI56wAPpqxmX/cGjX85G/+dkXUYDAi5lx lXNcDVmV48AgBq2AoKWsH2Fiz29kfWcF4ClbxnlkhoomW9eJzZ0O9hYheIuU/E1TPj2t NsMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=75WxO2o1ANUQ23e7/l2/5rNs/NOLt4FGGwCAxlIKBW0=; b=YYD7XgD7/0+5nESQrBcHsU3cCzE9cafWz5YJz8/Tvlc3DwuFSLvnAH5P0stwiP8rMd HornAPyqWlOQpbPh8ZGgqJpdO1qLcWWNW+jCY6xQ7EhTH92O86Kbp4HAs/4trYMh2SKT DNNkhIGGgjwm792AKSlodGNga12m357VsDni4lpqPfdDURhMq40w3jG7faIs3OK1sayk 0spxrQ762E/oKyOA5IEkzYxjg3m0QmjyHiCn4JaZuyB135qUVI8HGgCLr/BJy8G9Kq8R fokr9KRW+6nSQO9Rgnso0MNOmIwOaVPuYiQ2/uLO6xYzXHwdfKHJLoPXJUUOlVYQibR+ jxhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qx1z00X5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si1111079pga.554.2019.06.13.18.56.48; Thu, 13 Jun 2019 18:57:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qx1z00X5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbfFNB4j (ORCPT + 99 others); Thu, 13 Jun 2019 21:56:39 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:32880 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfFNB4i (ORCPT ); Thu, 13 Jun 2019 21:56:38 -0400 Received: by mail-pg1-f193.google.com with SMTP id k187so586927pga.0; Thu, 13 Jun 2019 18:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=75WxO2o1ANUQ23e7/l2/5rNs/NOLt4FGGwCAxlIKBW0=; b=qx1z00X5ideAjYd6TZno/ffdD3lXZInAFbMTneAqyt87oXP1watdYXmJaxvV7i70+G QpegO3wNlUlp8uYvqU7gCtA0MMQ+50hw60oZ2oxmw9x2Jy4gnpJIQzra6tLSMwfBxixg oxoSLws8KwRRq3WsL51VV1fof5qGlk1TNyAVDX20xydqNskOTyUeGxnQn5kpTy3OzlgA sG0iO7FqjL8JbO7fRzeM30Ap62l7DtUtqZawypoCeMS4jDMsqiDV4AdS+fukMbglBWcy R7RseVVwtMQ3x41JRBOLGi1B+ojxYMpL3G6psCVFbFKe4UPn0loETZobi3dZKh3TanSo Ty/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=75WxO2o1ANUQ23e7/l2/5rNs/NOLt4FGGwCAxlIKBW0=; b=DhkHoJhAhMYOI5lhkT54dYzYAjFTctWd1611tYIl5s+vUeLFecQEJCTtFOVo0+BrBe UKK9pyxHNkJ/aUodlJgsi2eefPL4cV1qi7e5Ncn/ERmpjZnNGs8z619wzHhKh+yA41PD eAEXj4Kh39GRcVfr83SbAroVz73cnrNiNzzfXmOI/UTtopIg4JLI127npdlj1nSy2WsT ldJ7dueMH/IYUoHJkWsEnBIkZHVl64DK1k1GCTQ4cC8/J4kr13sYBy8GzjhWkEw0JR4Z K5K3fiNTrBgip/kPXe2D3X8avZ1AtwM9HUvoxhUJWmuKjCxOAnllf30KaDLHso+K4hYY HVXQ== X-Gm-Message-State: APjAAAUEmOLO2kP3DPrWDSNYdT7e1hNJeD61xRdFhfMYFINst1/neMjb qoG+jGlU30nguaXmY5jRXyU= X-Received: by 2002:a63:ee12:: with SMTP id e18mr34123441pgi.412.1560477397146; Thu, 13 Jun 2019 18:56:37 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::2:9d14]) by smtp.gmail.com with ESMTPSA id z11sm1029370pjn.2.2019.06.13.18.56.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 18:56:36 -0700 (PDT) From: Tejun Heo To: axboe@kernel.dk, newella@fb.com, clm@fb.com, josef@toxicpanda.com, dennisz@fb.com, lizefan@huawei.com, hannes@cmpxchg.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, kernel-team@fb.com, cgroups@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, bpf@vger.kernel.org, Tejun Heo Subject: [PATCH 02/10] blkcg: make ->cpd_init_fn() optional Date: Thu, 13 Jun 2019 18:56:12 -0700 Message-Id: <20190614015620.1587672-3-tj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190614015620.1587672-1-tj@kernel.org> References: <20190614015620.1587672-1-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For policies which can do enough initialization from ->cpd_alloc_fn(), make ->cpd_init_fn() optional. Signed-off-by: Tejun Heo --- 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 30d3a0fbccac..60ad9b96e6eb 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1534,7 +1534,8 @@ int blkcg_policy_register(struct blkcg_policy *pol) blkcg->cpd[pol->plid] = cpd; cpd->blkcg = blkcg; cpd->plid = pol->plid; - pol->cpd_init_fn(cpd); + if (pol->cpd_init_fn) + pol->cpd_init_fn(cpd); } } -- 2.17.1