aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/bcache/request.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-10-17 17:04:47 +0300
committerGleb Natapov <gleb@redhat.com>2013-10-17 17:41:49 +0300
commit13acfd5715144518232d8e29acf7c76ef1b089d8 (patch)
tree093c4311a737210bbdd3d1919f8193cb5f017241 /drivers/md/bcache/request.c
parentd570142674890fe10b3d7d86aa105e3dfce1ddfa (diff)
parent34ec4de42be5006abdd8d0c08b306ffaa64d0d5d (diff)
Powerpc KVM work is based on a commit after rc4.
Merging master into next to satisfy the dependencies. Conflicts: arch/arm/kvm/reset.c
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r--drivers/md/bcache/request.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 786a1a4f74d8..b6a74bcbb08f 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -996,17 +996,19 @@ static void request_write(struct cached_dev *dc, struct search *s)
closure_bio_submit(bio, cl, s->d);
} else {
bch_writeback_add(dc);
+ s->op.cache_bio = bio;
- if (s->op.flush_journal) {
+ if (bio->bi_rw & REQ_FLUSH) {
/* Also need to send a flush to the backing device */
- s->op.cache_bio = bio_clone_bioset(bio, GFP_NOIO,
- dc->disk.bio_split);
-
- bio->bi_size = 0;
- bio->bi_vcnt = 0;
- closure_bio_submit(bio, cl, s->d);
- } else {
- s->op.cache_bio = bio;
+ struct bio *flush = bio_alloc_bioset(0, GFP_NOIO,
+ dc->disk.bio_split);
+
+ flush->bi_rw = WRITE_FLUSH;
+ flush->bi_bdev = bio->bi_bdev;
+ flush->bi_end_io = request_endio;
+ flush->bi_private = cl;
+
+ closure_bio_submit(flush, cl, s->d);
}
}
out: