aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-09-20 14:33:12 +0200
committerJens Axboe <axboe@kernel.dk>2021-10-18 06:17:01 -0600
commit348332e000697b4ca82ef96719e02876434b8346 (patch)
tree951292e682a52babe7dae0b25a403e63520c7fab /include/linux/writeback.h
parentblk-cgroup: blk_cgroup_bio_start() should use irq-safe operations on blkg->iostat_cpu (diff)
downloadwireguard-linux-348332e000697b4ca82ef96719e02876434b8346.tar.xz
wireguard-linux-348332e000697b4ca82ef96719e02876434b8346.zip
mm: don't include <linux/blk-cgroup.h> in <linux/writeback.h>
blk-cgroup.h pulls in blkdev.h and thus pretty much all the block headers. Break this dependency chain by turning wbc_blkcg_css into a macro and dropping the blk-cgroup.h include. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20210920123328.1399408-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index d1f65adf6a26..8eb165760752 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -11,7 +11,6 @@
#include <linux/flex_proportions.h>
#include <linux/backing-dev-defs.h>
#include <linux/blk_types.h>
-#include <linux/blk-cgroup.h>
struct bio;
@@ -109,15 +108,12 @@ static inline int wbc_to_write_flags(struct writeback_control *wbc)
return flags;
}
-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;
-}
+#define wbc_blkcg_css(wbc) \
+ ((wbc)->wb ? (wbc)->wb->blkcg_css : blkcg_root_css)
+#else
+#define wbc_blkcg_css(wbc) (blkcg_root_css)
+#endif /* CONFIG_CGROUP_WRITEBACK */
/*
* A wb_domain represents a domain that wb's (bdi_writeback's) belong to