diff options
author | Jens Axboe <axboe@fb.com> | 2016-11-01 10:00:38 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-02 10:24:03 -0600 |
commit | 7637241e651ec36e409412869f986dd5f097735f (patch) | |
tree | f91af371cfe570476ba301a33bcb4c3780c430b1 /include/linux/writeback.h | |
parent | 1d796d6a9641fbfcd90fcfaf6fb4894a13d0304f (diff) | |
download | linux-stable-7637241e651ec36e409412869f986dd5f097735f.tar.gz linux-stable-7637241e651ec36e409412869f986dd5f097735f.tar.bz2 linux-stable-7637241e651ec36e409412869f986dd5f097735f.zip |
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 @@ #include <linux/fs.h> #include <linux/flex_proportions.h> #include <linux/backing-dev-defs.h> +#include <linux/blk_types.h> struct bio; @@ -102,6 +103,14 @@ struct writeback_control { #endif }; +static inline int wbc_to_write_flags(struct writeback_control *wbc) +{ + if (wbc->sync_mode == WB_SYNC_ALL) + return REQ_SYNC; + + return 0; +} + /* * A wb_domain represents a domain that wb's (bdi_writeback's) belong to * and are measured against each other in. There always is one global |