Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp349181ybi; Thu, 13 Jun 2019 17:36:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfT+vM+DZpCBzZGVAe4nm10Cz5Kfx+ydJ0m6JpRXS5FBA+6ATYCDCLSZLsoN8W+vtbQcd4 X-Received: by 2002:aa7:8dcc:: with SMTP id j12mr30471217pfr.137.1560472563627; Thu, 13 Jun 2019 17:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560472563; cv=none; d=google.com; s=arc-20160816; b=vc302Aop16r7TfoSa9GSA3uPBk2xOQai+QBA5VgnD5fQ9gaGFkpm5X2tz7XBj1h8Cq rdI7RpU02iV3qqUnLw89/rgGCkUIciVeTCrzSXB3U60TjaQgmXxnJv4rqcO0dk8FFqTR jMopmRAV6VROCPGb0s9WT+PqQvw7GGAv4rgSxMo3J7RG3dDooq4SO+CkcfOTJ3wTX6r6 EPH7dWHhF+PbHAdiVkJ+/9ycmTU7mCpUVa9jxwKBcKjS4ycQ4l24+TxG+5rjMFIjhzqX pSSdZw5T8UigO4jUE8h5wtT42vInYp+Fte4NK0jJ6I77NHBDfLghqPVnqWcDdWctlqff dW+Q== 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=J+WIIloOg8R89ClRTeMiBEyvJHmr12Pt7f1GOmgErrg=; b=MISww+RU5mzzT6acv9pU+D8u4yk5UuwFK8VsSFowN/uCrCoGVD1uKi5VlpjiPwAdG7 JwOf7el8P6yOrqU/hKDbUYmNoHRKmq5QarXFTUPAqbGeG00Rzd5ASUvv9/hkgTKMSiMI /HZIkvqxaV8+lhrGGObg3lIPbFZyfcdT7Fv93SCT0mbH84c8uzG4MH6NR/292DMGXK3o Pjf77XjNdUPW1C5ySf6fLQOXLhEoLX9TObN61MQIdi7uoIhIGOoc+ll0Gl1siTuUSq+3 2+D4HdwKTjx3vr+nYoDBUNwurOd6sCjojGkYnzKUlcoD6Ls1O7CVfhxE95RAEb0C4o9R dbtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YhRTqGTu; 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 j36si802385plb.77.2019.06.13.17.35.48; Thu, 13 Jun 2019 17:36: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=YhRTqGTu; 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 S1727074AbfFNAeC (ORCPT + 99 others); Thu, 13 Jun 2019 20:34:02 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:35200 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727001AbfFNAd7 (ORCPT ); Thu, 13 Jun 2019 20:33:59 -0400 Received: by mail-pg1-f195.google.com with SMTP id s27so471771pgl.2; Thu, 13 Jun 2019 17:33:59 -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=J+WIIloOg8R89ClRTeMiBEyvJHmr12Pt7f1GOmgErrg=; b=YhRTqGTux1UNwJbR9l++EjV3FIfs4oZYe2F/+74GkB28vP13HoaYTz1OOgDbnCwuAn 7PTQk5aAmp3XVlQFWDwzMZKCoiY2Nt4VrW/UCS4aucRv8Tkl1lSnWF8trTiEPjVnzVEp OIyCgZUn+Hq6FjOA/cwjGotXXWat43A8uaMwa139+gx/OkrnHit+w4xLIxpuarPGfWzc bg1XsyDLeM5ikjMmd3AVa7DXwf4VE9am6/XJE7BQh14YR5Ax7uZg+EjXhY5OWbISVx2q XZuk2A+iD3Oj2Qb+QmOJrWS4CX8tNF1TYSxOGeFNyhjgxD7LPjVSkW9VQoHF7eSwcQzV 0JiA== 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=J+WIIloOg8R89ClRTeMiBEyvJHmr12Pt7f1GOmgErrg=; b=qvM4KuI3Rv9cgI926sawFC2XTf7pnW3YfR5IS9b8RSEUvP//r9PnResikaD149+wKh 7UfjhozhvUt7elezpuC2J3og2O/k1PPurRzf6bqAGrJn5cZArYHs5Ic3gQYdXCltGDzZ At4z9+26ZN48h6HLo0cIAhB6WOHDSUYKcSF7Qh5NZZ9OeaX0yJhjRLdaj+g48siQLsk4 S2F9HN32sbrHIRKHlEZoxvaATdPQ7io7K1whpr0gNpbeflJ/7CKP7xZu/ULc+ZZJ9C6E ZOR647C3KTQzTfOyffQR37rKAvFku2+2xtHH1xIUR5SvGFnKkVEaWVsdoX+uYRoHKJRJ aBMw== X-Gm-Message-State: APjAAAUNZc2n1gEdNlzm7O3JtUO/EvbqdC5SAUDKfpJuKaF4V/ZLxNig GUZuuwpIecyohqExmn9omVk= X-Received: by 2002:a17:90a:bb01:: with SMTP id u1mr7185132pjr.92.1560472438757; Thu, 13 Jun 2019 17:33:58 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::2:9d14]) by smtp.gmail.com with ESMTPSA id p1sm827742pff.74.2019.06.13.17.33.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 17:33:58 -0700 (PDT) From: Tejun Heo To: dsterba@suse.com, clm@fb.com, josef@toxicpanda.com, axboe@kernel.dk, jack@suse.cz Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, kernel-team@fb.com, Tejun Heo Subject: [PATCH 2/8] blkcg, writeback: Implement wbc_blkcg_css() Date: Thu, 13 Jun 2019 17:33:44 -0700 Message-Id: <20190614003350.1178444-3-tj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190614003350.1178444-1-tj@kernel.org> References: <20190614003350.1178444-1-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a helper to determine the target blkcg from wbc. Signed-off-by: Tejun Heo --- include/linux/writeback.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/writeback.h b/include/linux/writeback.h index b8f5f000cde4..1c85563f035d 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -93,6 +93,16 @@ static inline int wbc_to_write_flags(struct writeback_control *wbc) return 0; } +static inline struct cgroup_subsys_state * +wbc_blkcg_css(struct writeback_control *wbc) +{ +#ifdef CONFIG_CGROUP_WRITEBACK + if (wbc->wb) + return wbc->wb->blkcg_css; +#endif + return blkcg_root_css; +} + /* * A wb_domain represents a domain that wb's (bdi_writeback's) belong to * and are measured against each other in. There always is one global -- 2.17.1