aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 797100e10010..5527d910ba3d 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -9,6 +9,9 @@
9#include <linux/fs.h> 9#include <linux/fs.h>
10#include <linux/flex_proportions.h> 10#include <linux/flex_proportions.h>
11#include <linux/backing-dev-defs.h> 11#include <linux/backing-dev-defs.h>
12#include <linux/blk_types.h>
13
14struct bio;
12 15
13DECLARE_PER_CPU(int, dirty_throttle_leaks); 16DECLARE_PER_CPU(int, dirty_throttle_leaks);
14 17
@@ -100,6 +103,16 @@ struct writeback_control {
100#endif 103#endif
101}; 104};
102 105
106static inline int wbc_to_write_flags(struct writeback_control *wbc)
107{
108 if (wbc->sync_mode == WB_SYNC_ALL)
109 return REQ_SYNC;
110 else if (wbc->for_kupdate || wbc->for_background)
111 return REQ_BACKGROUND;
112
113 return 0;
114}
115
103/* 116/*
104 * A wb_domain represents a domain that wb's (bdi_writeback's) belong to 117 * A wb_domain represents a domain that wb's (bdi_writeback's) belong to
105 * and are measured against each other in. There always is one global 118 * and are measured against each other in. There always is one global
@@ -362,7 +375,6 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
362unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh); 375unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
363 376
364void wb_update_bandwidth(struct bdi_writeback *wb, unsigned long start_time); 377void wb_update_bandwidth(struct bdi_writeback *wb, unsigned long start_time);
365void page_writeback_init(void);
366void balance_dirty_pages_ratelimited(struct address_space *mapping); 378void balance_dirty_pages_ratelimited(struct address_space *mapping);
367bool wb_over_bg_thresh(struct bdi_writeback *wb); 379bool wb_over_bg_thresh(struct bdi_writeback *wb);
368 380