diff options
author | Mike Christie <mchristi@redhat.com> | 2016-06-05 15:32:04 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-07 15:41:38 -0400 |
commit | e6047149db702374f240dc18bab665479e25a8cc (patch) | |
tree | 4a07c091de4b1d1d506b911a5f94e6cd6b5b6ba4 /drivers/md/dm-cache-target.c | |
parent | 528ec5abe6808c367b13f51945829eba24b1fc17 (diff) |
dm: use bio op accessors
Separate the op from the rq_flag_bits and have dm
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/dm-cache-target.c')
-rw-r--r-- | drivers/md/dm-cache-target.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index ee0510f9a85e..540e80eb317d 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -788,7 +788,8 @@ static void check_if_tick_bio_needed(struct cache *cache, struct bio *bio) | |||
788 | 788 | ||
789 | spin_lock_irqsave(&cache->lock, flags); | 789 | spin_lock_irqsave(&cache->lock, flags); |
790 | if (cache->need_tick_bio && | 790 | if (cache->need_tick_bio && |
791 | !(bio->bi_rw & (REQ_FUA | REQ_FLUSH | REQ_DISCARD))) { | 791 | !(bio->bi_rw & (REQ_FUA | REQ_FLUSH)) && |
792 | bio_op(bio) != REQ_OP_DISCARD) { | ||
792 | pb->tick = true; | 793 | pb->tick = true; |
793 | cache->need_tick_bio = false; | 794 | cache->need_tick_bio = false; |
794 | } | 795 | } |
@@ -851,7 +852,7 @@ static void inc_ds(struct cache *cache, struct bio *bio, | |||
851 | static bool accountable_bio(struct cache *cache, struct bio *bio) | 852 | static bool accountable_bio(struct cache *cache, struct bio *bio) |
852 | { | 853 | { |
853 | return ((bio->bi_bdev == cache->origin_dev->bdev) && | 854 | return ((bio->bi_bdev == cache->origin_dev->bdev) && |
854 | !(bio->bi_rw & REQ_DISCARD)); | 855 | bio_op(bio) != REQ_OP_DISCARD); |
855 | } | 856 | } |
856 | 857 | ||
857 | static void accounted_begin(struct cache *cache, struct bio *bio) | 858 | static void accounted_begin(struct cache *cache, struct bio *bio) |
@@ -1067,7 +1068,8 @@ static void dec_io_migrations(struct cache *cache) | |||
1067 | 1068 | ||
1068 | static bool discard_or_flush(struct bio *bio) | 1069 | static bool discard_or_flush(struct bio *bio) |
1069 | { | 1070 | { |
1070 | return bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD); | 1071 | return bio_op(bio) == REQ_OP_DISCARD || |
1072 | bio->bi_rw & (REQ_FLUSH | REQ_FUA); | ||
1071 | } | 1073 | } |
1072 | 1074 | ||
1073 | static void __cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell) | 1075 | static void __cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell) |
@@ -1980,7 +1982,7 @@ static void process_deferred_bios(struct cache *cache) | |||
1980 | 1982 | ||
1981 | if (bio->bi_rw & REQ_FLUSH) | 1983 | if (bio->bi_rw & REQ_FLUSH) |
1982 | process_flush_bio(cache, bio); | 1984 | process_flush_bio(cache, bio); |
1983 | else if (bio->bi_rw & REQ_DISCARD) | 1985 | else if (bio_op(bio) == REQ_OP_DISCARD) |
1984 | process_discard_bio(cache, &structs, bio); | 1986 | process_discard_bio(cache, &structs, bio); |
1985 | else | 1987 | else |
1986 | process_bio(cache, &structs, bio); | 1988 | process_bio(cache, &structs, bio); |