diff options
author | Jens Axboe <axboe@fb.com> | 2016-11-01 12:00:38 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-02 12:24:03 -0400 |
commit | 7637241e651ec36e409412869f986dd5f097735f (patch) | |
tree | f91af371cfe570476ba301a33bcb4c3780c430b1 /include/linux/writeback.h | |
parent | 1d796d6a9641fbfcd90fcfaf6fb4894a13d0304f (diff) |
writeback: add wbc_to_write_flags()
Add wbc_to_write_flags(), which returns the write modifier flags to use,
based on a struct writeback_control. No functional changes in this
patch, but it prepares us for factoring other wbc fields for write type.
Signed-off-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r-- | include/linux/writeback.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index e4c38703bf4e..50c96ee8108f 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -9,6 +9,7 @@ | |||
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> | ||
12 | 13 | ||
13 | struct bio; | 14 | struct bio; |
14 | 15 | ||
@@ -102,6 +103,14 @@ struct writeback_control { | |||
102 | #endif | 103 | #endif |
103 | }; | 104 | }; |
104 | 105 | ||
106 | static inline int wbc_to_write_flags(struct writeback_control *wbc) | ||
107 | { | ||
108 | if (wbc->sync_mode == WB_SYNC_ALL) | ||
109 | return REQ_SYNC; | ||
110 | |||
111 | return 0; | ||
112 | } | ||
113 | |||
105 | /* | 114 | /* |
106 | * A wb_domain represents a domain that wb's (bdi_writeback's) belong to | 115 | * A wb_domain represents a domain that wb's (bdi_writeback's) belong to |
107 | * and are measured against each other in. There always is one global | 116 | * and are measured against each other in. There always is one global |