mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
1d796d6a96
commit
7637241e65
8 changed files with 17 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue