|
@@ -230,6 +230,7 @@ struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi,
|
|
void __inode_attach_wb(struct inode *inode, struct page *page);
|
|
void __inode_attach_wb(struct inode *inode, struct page *page);
|
|
void wb_memcg_offline(struct mem_cgroup *memcg);
|
|
void wb_memcg_offline(struct mem_cgroup *memcg);
|
|
void wb_blkcg_offline(struct blkcg *blkcg);
|
|
void wb_blkcg_offline(struct blkcg *blkcg);
|
|
|
|
+int inode_congested(struct inode *inode, int cong_bits);
|
|
|
|
|
|
/**
|
|
/**
|
|
* inode_cgwb_enabled - test whether cgroup writeback is enabled on an inode
|
|
* inode_cgwb_enabled - test whether cgroup writeback is enabled on an inode
|
|
@@ -438,8 +439,29 @@ static inline void wb_blkcg_offline(struct blkcg *blkcg)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline int inode_congested(struct inode *inode, int cong_bits)
|
|
|
|
+{
|
|
|
|
+ return wb_congested(&inode_to_bdi(inode)->wb, cong_bits);
|
|
|
|
+}
|
|
|
|
+
|
|
#endif /* CONFIG_CGROUP_WRITEBACK */
|
|
#endif /* CONFIG_CGROUP_WRITEBACK */
|
|
|
|
|
|
|
|
+static inline int inode_read_congested(struct inode *inode)
|
|
|
|
+{
|
|
|
|
+ return inode_congested(inode, 1 << WB_sync_congested);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline int inode_write_congested(struct inode *inode)
|
|
|
|
+{
|
|
|
|
+ return inode_congested(inode, 1 << WB_async_congested);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline int inode_rw_congested(struct inode *inode)
|
|
|
|
+{
|
|
|
|
+ return inode_congested(inode, (1 << WB_sync_congested) |
|
|
|
|
+ (1 << WB_async_congested));
|
|
|
|
+}
|
|
|
|
+
|
|
static inline int bdi_congested(struct backing_dev_info *bdi, int cong_bits)
|
|
static inline int bdi_congested(struct backing_dev_info *bdi, int cong_bits)
|
|
{
|
|
{
|
|
return wb_congested(&bdi->wb, cong_bits);
|
|
return wb_congested(&bdi->wb, cong_bits);
|