aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-07-10 21:44:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-28 19:30:09 -0400
commit3fcbc17636c83da9d85e2604de4af56c215e6e3c (patch)
treee3c8e7fc4cad85412c2a8326de6d752cacd3fd68 /drivers/md/bcache
parentc0d8f455600820eb05208b57c50d4e90a58c4d96 (diff)
bcache: Advertise that flushes are supported
commit 54d12f2b4fd0f218590d1490b41a18d0e2328a9a upstream. Whoops - bcache's flush/FUA was mostly correct, but flushes get filtered out unless we say we support them... Signed-off-by: Kent Overstreet <kmo@daterainc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r--drivers/md/bcache/request.c8
-rw-r--r--drivers/md/bcache/super.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index e5ff12e52d5b..2f36743ce708 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -489,6 +489,12 @@ static void bch_insert_data_loop(struct closure *cl)
489 bch_queue_gc(op->c); 489 bch_queue_gc(op->c);
490 } 490 }
491 491
492 /*
493 * Journal writes are marked REQ_FLUSH; if the original write was a
494 * flush, it'll wait on the journal write.
495 */
496 bio->bi_rw &= ~(REQ_FLUSH|REQ_FUA);
497
492 do { 498 do {
493 unsigned i; 499 unsigned i;
494 struct bkey *k; 500 struct bkey *k;
@@ -716,7 +722,7 @@ static struct search *search_alloc(struct bio *bio, struct bcache_device *d)
716 s->task = current; 722 s->task = current;
717 s->orig_bio = bio; 723 s->orig_bio = bio;
718 s->write = (bio->bi_rw & REQ_WRITE) != 0; 724 s->write = (bio->bi_rw & REQ_WRITE) != 0;
719 s->op.flush_journal = (bio->bi_rw & REQ_FLUSH) != 0; 725 s->op.flush_journal = (bio->bi_rw & (REQ_FLUSH|REQ_FUA)) != 0;
720 s->op.skip = (bio->bi_rw & REQ_DISCARD) != 0; 726 s->op.skip = (bio->bi_rw & REQ_DISCARD) != 0;
721 s->recoverable = 1; 727 s->recoverable = 1;
722 s->start_time = jiffies; 728 s->start_time = jiffies;
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index f88e2b653a3f..a7d9828b01d1 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -781,6 +781,8 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size)
781 set_bit(QUEUE_FLAG_NONROT, &d->disk->queue->queue_flags); 781 set_bit(QUEUE_FLAG_NONROT, &d->disk->queue->queue_flags);
782 set_bit(QUEUE_FLAG_DISCARD, &d->disk->queue->queue_flags); 782 set_bit(QUEUE_FLAG_DISCARD, &d->disk->queue->queue_flags);
783 783
784 blk_queue_flush(q, REQ_FLUSH|REQ_FUA);
785
784 return 0; 786 return 0;
785} 787}
786 788