diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-03-04 13:55:59 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-01-18 21:37:39 -0900 |
commit | 6ad4b0f1e9c34bca90075326bb54574b2328cc09 (patch) | |
tree | bf41266ed43e1743a0970da27c11bcc5de1204b8 | |
parent | 0ac45c122460fa556599e6c996293ceeb2d241f0 (diff) |
bcache: plumb through WRITE_SYNC
-rw-r--r-- | drivers/md/bcache/fs-io.c | 5 | ||||
-rw-r--r-- | drivers/md/bcache/io.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/bcache/fs-io.c b/drivers/md/bcache/fs-io.c index 654567ccaae1..3cc53a41c516 100644 --- a/drivers/md/bcache/fs-io.c +++ b/drivers/md/bcache/fs-io.c @@ -517,6 +517,9 @@ do_io: bch_writepage_io_alloc(w, ei, page); + if (wbc->sync_mode == WB_SYNC_ALL) + w->io->bio.bio.bio.bi_opf |= WRITE_SYNC; + /* * Before unlocking the page, transfer refcounts to w->io: */ @@ -575,7 +578,7 @@ int bch_writepage(struct page *page, struct writeback_control *wbc) .io = NULL, }; - ret = __bch_writepage(page, NULL, &w); + ret = __bch_writepage(page, wbc, &w); if (ret) return ret; diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index 5ef15ed1cfea..ead91726dbc1 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c @@ -886,6 +886,8 @@ static void bch_write_extent(struct bch_write_op *op, bio = bio_compress(c, orig, &compression_type, output_available); + /* copy WRITE_SYNC flag */ + bio->bi_opf = orig->bi_opf; orig->bi_iter.bi_size += extra_input; |