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 /mm/page_io.c | |
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 'mm/page_io.c')
-rw-r--r-- | mm/page_io.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/page_io.c b/mm/page_io.c index a2651f58c86a..23f6d0d3470f 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -320,10 +320,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, ret = -ENOMEM; goto out; } - if (wbc->sync_mode == WB_SYNC_ALL) - bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_SYNC); - else - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); + bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc); count_vm_event(PSWPOUT); set_page_writeback(page); unlock_page(page); |