diff options
author | Mike Christie <mchristi@redhat.com> | 2016-06-05 15:32:05 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-07 15:41:38 -0400 |
commit | ad0d9e76a4124708dddd00c04fc4b56fc86c02d6 (patch) | |
tree | 51afdb370ca5d61d5c5b37a319fcbc30460f8335 /drivers/md/bcache/request.c | |
parent | e6047149db702374f240dc18bab665479e25a8cc (diff) |
bcache: use bio op accessors
Separate the op from the rq_flag_bits and have bcache
set/get the bio using bio_set_op_attrs/bio_op.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r-- | drivers/md/bcache/request.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 6b85a23ec92a..016b0aa7199c 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -253,7 +253,7 @@ static void bch_data_insert_start(struct closure *cl) | |||
253 | trace_bcache_cache_insert(k); | 253 | trace_bcache_cache_insert(k); |
254 | bch_keylist_push(&op->insert_keys); | 254 | bch_keylist_push(&op->insert_keys); |
255 | 255 | ||
256 | n->bi_rw |= REQ_WRITE; | 256 | bio_set_op_attrs(n, REQ_OP_WRITE, 0); |
257 | bch_submit_bbio(n, op->c, k, 0); | 257 | bch_submit_bbio(n, op->c, k, 0); |
258 | } while (n != bio); | 258 | } while (n != bio); |
259 | 259 | ||
@@ -378,7 +378,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) | |||
378 | 378 | ||
379 | if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || | 379 | if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || |
380 | c->gc_stats.in_use > CUTOFF_CACHE_ADD || | 380 | c->gc_stats.in_use > CUTOFF_CACHE_ADD || |
381 | (bio->bi_rw & REQ_DISCARD)) | 381 | (bio_op(bio) == REQ_OP_DISCARD)) |
382 | goto skip; | 382 | goto skip; |
383 | 383 | ||
384 | if (mode == CACHE_MODE_NONE || | 384 | if (mode == CACHE_MODE_NONE || |
@@ -899,7 +899,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) | |||
899 | * But check_overlapping drops dirty keys for which io hasn't started, | 899 | * But check_overlapping drops dirty keys for which io hasn't started, |
900 | * so we still want to call it. | 900 | * so we still want to call it. |
901 | */ | 901 | */ |
902 | if (bio->bi_rw & REQ_DISCARD) | 902 | if (bio_op(bio) == REQ_OP_DISCARD) |
903 | s->iop.bypass = true; | 903 | s->iop.bypass = true; |
904 | 904 | ||
905 | if (should_writeback(dc, s->orig_bio, | 905 | if (should_writeback(dc, s->orig_bio, |
@@ -913,7 +913,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) | |||
913 | s->iop.bio = s->orig_bio; | 913 | s->iop.bio = s->orig_bio; |
914 | bio_get(s->iop.bio); | 914 | bio_get(s->iop.bio); |
915 | 915 | ||
916 | if (!(bio->bi_rw & REQ_DISCARD) || | 916 | if ((bio_op(bio) != REQ_OP_DISCARD) || |
917 | blk_queue_discard(bdev_get_queue(dc->bdev))) | 917 | blk_queue_discard(bdev_get_queue(dc->bdev))) |
918 | closure_bio_submit(bio, cl); | 918 | closure_bio_submit(bio, cl); |
919 | } else if (s->iop.writeback) { | 919 | } else if (s->iop.writeback) { |
@@ -925,10 +925,10 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) | |||
925 | struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0, | 925 | struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0, |
926 | dc->disk.bio_split); | 926 | dc->disk.bio_split); |
927 | 927 | ||
928 | flush->bi_rw = WRITE_FLUSH; | ||
929 | flush->bi_bdev = bio->bi_bdev; | 928 | flush->bi_bdev = bio->bi_bdev; |
930 | flush->bi_end_io = request_endio; | 929 | flush->bi_end_io = request_endio; |
931 | flush->bi_private = cl; | 930 | flush->bi_private = cl; |
931 | bio_set_op_attrs(flush, REQ_OP_WRITE, WRITE_FLUSH); | ||
932 | 932 | ||
933 | closure_bio_submit(flush, cl); | 933 | closure_bio_submit(flush, cl); |
934 | } | 934 | } |
@@ -992,7 +992,7 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q, | |||
992 | cached_dev_read(dc, s); | 992 | cached_dev_read(dc, s); |
993 | } | 993 | } |
994 | } else { | 994 | } else { |
995 | if ((bio->bi_rw & REQ_DISCARD) && | 995 | if ((bio_op(bio) == REQ_OP_DISCARD) && |
996 | !blk_queue_discard(bdev_get_queue(dc->bdev))) | 996 | !blk_queue_discard(bdev_get_queue(dc->bdev))) |
997 | bio_endio(bio); | 997 | bio_endio(bio); |
998 | else | 998 | else |
@@ -1103,7 +1103,7 @@ static blk_qc_t flash_dev_make_request(struct request_queue *q, | |||
1103 | &KEY(d->id, bio->bi_iter.bi_sector, 0), | 1103 | &KEY(d->id, bio->bi_iter.bi_sector, 0), |
1104 | &KEY(d->id, bio_end_sector(bio), 0)); | 1104 | &KEY(d->id, bio_end_sector(bio), 0)); |
1105 | 1105 | ||
1106 | s->iop.bypass = (bio->bi_rw & REQ_DISCARD) != 0; | 1106 | s->iop.bypass = (bio_op(bio) == REQ_OP_DISCARD) != 0; |
1107 | s->iop.writeback = true; | 1107 | s->iop.writeback = true; |
1108 | s->iop.bio = bio; | 1108 | s->iop.bio = bio; |
1109 | 1109 | ||