[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190627203952.386785-5-tj@kernel.org>
Date: Thu, 27 Jun 2019 13:39:51 -0700
From: Tejun Heo <tj@...nel.org>
To: axboe@...nel.dk
Cc: jack@...e.cz, josef@...icpanda.com, clm@...com, dsterba@...e.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-btrfs@...r.kernel.org, kernel-team@...com,
Tejun Heo <tj@...nel.org>
Subject: [PATCH 4/5] blkcg, writeback: Implement wbc_blkcg_css()
Add a helper to determine the target blkcg from wbc.
Signed-off-by: Tejun Heo <tj@...nel.org>
Reviewed-by: Josef Bacik <josef@...icpanda.com>
Reviewed-by: Jan Kara <jack@...e.cz>
---
include/linux/writeback.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 33a50fa09fac..e056a22075cf 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -11,6 +11,7 @@
#include <linux/flex_proportions.h>
#include <linux/backing-dev-defs.h>
#include <linux/blk_types.h>
+#include <linux/blk-cgroup.h>
struct bio;
@@ -101,6 +102,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
Powered by blists - more mailing lists