diff options
author | Tejun Heo <tj@kernel.org> | 2015-05-23 00:13:41 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-06-02 17:33:35 +0300 |
commit | ec8a6f2643923ee5b74d24fa8d134240379f436b (patch) | |
tree | 4188866bc98fb571c3c872d0ad972c5ccc974ee4 /include/linux/backing-dev-defs.h | |
parent | dfb8ae567835425d27db8acc6c9fc5db88d38e2b (diff) | |
download | linux-ec8a6f2643923ee5b74d24fa8d134240379f436b.tar.xz |
writeback: make congestion functions per bdi_writeback
Currently, all congestion functions take bdi (backing_dev_info) and
always operate on the root wb (bdi->wb) and the congestion state from
the block layer is propagated only for the root blkcg. This patch
introduces {set|clear}_wb_congested() and wb_congested() which take a
bdi_writeback_congested and bdi_writeback respectively. The bdi
counteparts are now wrappers invoking the wb based functions on
@bdi->wb.
While converting clear_bdi_congested() to clear_wb_congested(), the
local variable declaration order between @wqh and @bit is swapped for
cosmetic reason.
This patch just adds the new wb based functions. The following
patches will apply them.
v2: Updated for bdi_writeback_congested.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/backing-dev-defs.h')
-rw-r--r-- | include/linux/backing-dev-defs.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index a1e9c407a59a..eb386766b5f3 100644 --- a/include/linux/backing-dev-defs.h +++ b/include/linux/backing-dev-defs.h @@ -163,7 +163,17 @@ enum { BLK_RW_SYNC = 1, }; -void clear_bdi_congested(struct backing_dev_info *bdi, int sync); -void set_bdi_congested(struct backing_dev_info *bdi, int sync); +void clear_wb_congested(struct bdi_writeback_congested *congested, int sync); +void set_wb_congested(struct bdi_writeback_congested *congested, int sync); + +static inline void clear_bdi_congested(struct backing_dev_info *bdi, int sync) +{ + clear_wb_congested(bdi->wb.congested, sync); +} + +static inline void set_bdi_congested(struct backing_dev_info *bdi, int sync) +{ + set_wb_congested(bdi->wb.congested, sync); +} #endif /* __LINUX_BACKING_DEV_DEFS_H */ |