block: get rid of bio_rw and READA
[cascardo/linux.git] / drivers / md / dm-snap.c
index 69ab1ff..cc2f14b 100644 (file)
@@ -1696,7 +1696,8 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio)
         * to copy an exception */
        down_write(&s->lock);
 
-       if (!s->valid || (unlikely(s->snapshot_overflowed) && bio_rw(bio) == WRITE)) {
+       if (!s->valid || (unlikely(s->snapshot_overflowed) &&
+           bio_data_dir(bio) == WRITE)) {
                r = -EIO;
                goto out_unlock;
        }
@@ -1713,7 +1714,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio)
         * flags so we should only get this if we are
         * writeable.
         */
-       if (bio_rw(bio) == WRITE) {
+       if (bio_data_dir(bio) == WRITE) {
                pe = __lookup_pending_exception(s, chunk);
                if (!pe) {
                        up_write(&s->lock);
@@ -1819,7 +1820,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
        e = dm_lookup_exception(&s->complete, chunk);
        if (e) {
                /* Queue writes overlapping with chunks being merged */
-               if (bio_rw(bio) == WRITE &&
+               if (bio_data_dir(bio) == WRITE &&
                    chunk >= s->first_merging_chunk &&
                    chunk < (s->first_merging_chunk +
                             s->num_merging_chunks)) {
@@ -1831,7 +1832,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
 
                remap_exception(s, e, bio, chunk);
 
-               if (bio_rw(bio) == WRITE)
+               if (bio_data_dir(bio) == WRITE)
                        track_chunk(s, bio, chunk);
                goto out_unlock;
        }
@@ -1839,7 +1840,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
 redirect_to_origin:
        bio->bi_bdev = s->origin->bdev;
 
-       if (bio_rw(bio) == WRITE) {
+       if (bio_data_dir(bio) == WRITE) {
                up_write(&s->lock);
                return do_origin(s->origin, bio);
        }
@@ -2288,7 +2289,7 @@ static int origin_map(struct dm_target *ti, struct bio *bio)
        if (unlikely(bio->bi_rw & REQ_PREFLUSH))
                return DM_MAPIO_REMAPPED;
 
-       if (bio_rw(bio) != WRITE)
+       if (bio_data_dir(bio) != WRITE)
                return DM_MAPIO_REMAPPED;
 
        available_sectors = o->split_boundary -