diff options
| author | Ingo Molnar <[email protected]> | 2013-11-06 05:39:45 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2013-11-06 05:39:45 +0000 |
| commit | 97c53b402fcadb50201c23914f614bf8430d9c20 (patch) | |
| tree | 3c9b94e866d150c3a2d8ac853e388c38fade8b45 /drivers/md/bcache/request.c | |
| parent | hung_task debugging: Add tracepoint to report the hang (diff) | |
| parent | Linux 3.12 (diff) | |
| download | kernel-97c53b402fcadb50201c23914f614bf8430d9c20.tar.gz kernel-97c53b402fcadb50201c23914f614bf8430d9c20.zip | |
Merge tag 'v3.12' into core/locking to pick up mutex upates
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'drivers/md/bcache/request.c')
| -rw-r--r-- | drivers/md/bcache/request.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 786a1a4f74d8..2a7f0dd6abab 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); + struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0, + 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; + 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: |
