diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
| -rw-r--r-- | fs/btrfs/volumes.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d6e3af8be95b..dd318ff280b2 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
| @@ -258,7 +258,7 @@ loop_lock: | |||
| 258 | 258 | ||
| 259 | BUG_ON(atomic_read(&cur->bi_cnt) == 0); | 259 | BUG_ON(atomic_read(&cur->bi_cnt) == 0); |
| 260 | 260 | ||
| 261 | if (bio_rw_flagged(cur, BIO_RW_SYNCIO)) | 261 | if (cur->bi_rw & REQ_SYNC) |
| 262 | num_sync_run++; | 262 | num_sync_run++; |
| 263 | 263 | ||
| 264 | submit_bio(cur->bi_rw, cur); | 264 | submit_bio(cur->bi_rw, cur); |
| @@ -2651,7 +2651,7 @@ static int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | |||
| 2651 | int max_errors = 0; | 2651 | int max_errors = 0; |
| 2652 | struct btrfs_multi_bio *multi = NULL; | 2652 | struct btrfs_multi_bio *multi = NULL; |
| 2653 | 2653 | ||
| 2654 | if (multi_ret && !(rw & (1 << BIO_RW))) | 2654 | if (multi_ret && !(rw & REQ_WRITE)) |
| 2655 | stripes_allocated = 1; | 2655 | stripes_allocated = 1; |
| 2656 | again: | 2656 | again: |
| 2657 | if (multi_ret) { | 2657 | if (multi_ret) { |
| @@ -2687,7 +2687,7 @@ again: | |||
| 2687 | mirror_num = 0; | 2687 | mirror_num = 0; |
| 2688 | 2688 | ||
| 2689 | /* if our multi bio struct is too small, back off and try again */ | 2689 | /* if our multi bio struct is too small, back off and try again */ |
| 2690 | if (rw & (1 << BIO_RW)) { | 2690 | if (rw & REQ_WRITE) { |
| 2691 | if (map->type & (BTRFS_BLOCK_GROUP_RAID1 | | 2691 | if (map->type & (BTRFS_BLOCK_GROUP_RAID1 | |
| 2692 | BTRFS_BLOCK_GROUP_DUP)) { | 2692 | BTRFS_BLOCK_GROUP_DUP)) { |
| 2693 | stripes_required = map->num_stripes; | 2693 | stripes_required = map->num_stripes; |
| @@ -2697,7 +2697,7 @@ again: | |||
| 2697 | max_errors = 1; | 2697 | max_errors = 1; |
| 2698 | } | 2698 | } |
| 2699 | } | 2699 | } |
| 2700 | if (multi_ret && (rw & (1 << BIO_RW)) && | 2700 | if (multi_ret && (rw & REQ_WRITE) && |
| 2701 | stripes_allocated < stripes_required) { | 2701 | stripes_allocated < stripes_required) { |
| 2702 | stripes_allocated = map->num_stripes; | 2702 | stripes_allocated = map->num_stripes; |
| 2703 | free_extent_map(em); | 2703 | free_extent_map(em); |
| @@ -2733,7 +2733,7 @@ again: | |||
| 2733 | num_stripes = 1; | 2733 | num_stripes = 1; |
| 2734 | stripe_index = 0; | 2734 | stripe_index = 0; |
| 2735 | if (map->type & BTRFS_BLOCK_GROUP_RAID1) { | 2735 | if (map->type & BTRFS_BLOCK_GROUP_RAID1) { |
| 2736 | if (unplug_page || (rw & (1 << BIO_RW))) | 2736 | if (unplug_page || (rw & REQ_WRITE)) |
| 2737 | num_stripes = map->num_stripes; | 2737 | num_stripes = map->num_stripes; |
| 2738 | else if (mirror_num) | 2738 | else if (mirror_num) |
| 2739 | stripe_index = mirror_num - 1; | 2739 | stripe_index = mirror_num - 1; |
| @@ -2744,7 +2744,7 @@ again: | |||
| 2744 | } | 2744 | } |
| 2745 | 2745 | ||
| 2746 | } else if (map->type & BTRFS_BLOCK_GROUP_DUP) { | 2746 | } else if (map->type & BTRFS_BLOCK_GROUP_DUP) { |
| 2747 | if (rw & (1 << BIO_RW)) | 2747 | if (rw & REQ_WRITE) |
| 2748 | num_stripes = map->num_stripes; | 2748 | num_stripes = map->num_stripes; |
| 2749 | else if (mirror_num) | 2749 | else if (mirror_num) |
| 2750 | stripe_index = mirror_num - 1; | 2750 | stripe_index = mirror_num - 1; |
| @@ -2755,7 +2755,7 @@ again: | |||
| 2755 | stripe_index = do_div(stripe_nr, factor); | 2755 | stripe_index = do_div(stripe_nr, factor); |
| 2756 | stripe_index *= map->sub_stripes; | 2756 | stripe_index *= map->sub_stripes; |
| 2757 | 2757 | ||
| 2758 | if (unplug_page || (rw & (1 << BIO_RW))) | 2758 | if (unplug_page || (rw & REQ_WRITE)) |
| 2759 | num_stripes = map->sub_stripes; | 2759 | num_stripes = map->sub_stripes; |
| 2760 | else if (mirror_num) | 2760 | else if (mirror_num) |
| 2761 | stripe_index += mirror_num - 1; | 2761 | stripe_index += mirror_num - 1; |
| @@ -2945,7 +2945,7 @@ static noinline int schedule_bio(struct btrfs_root *root, | |||
| 2945 | struct btrfs_pending_bios *pending_bios; | 2945 | struct btrfs_pending_bios *pending_bios; |
| 2946 | 2946 | ||
| 2947 | /* don't bother with additional async steps for reads, right now */ | 2947 | /* don't bother with additional async steps for reads, right now */ |
| 2948 | if (!(rw & (1 << BIO_RW))) { | 2948 | if (!(rw & REQ_WRITE)) { |
| 2949 | bio_get(bio); | 2949 | bio_get(bio); |
| 2950 | submit_bio(rw, bio); | 2950 | submit_bio(rw, bio); |
| 2951 | bio_put(bio); | 2951 | bio_put(bio); |
| @@ -2964,7 +2964,7 @@ static noinline int schedule_bio(struct btrfs_root *root, | |||
| 2964 | bio->bi_rw |= rw; | 2964 | bio->bi_rw |= rw; |
| 2965 | 2965 | ||
| 2966 | spin_lock(&device->io_lock); | 2966 | spin_lock(&device->io_lock); |
| 2967 | if (bio_rw_flagged(bio, BIO_RW_SYNCIO)) | 2967 | if (bio->bi_rw & REQ_SYNC) |
| 2968 | pending_bios = &device->pending_sync_bios; | 2968 | pending_bios = &device->pending_sync_bios; |
| 2969 | else | 2969 | else |
| 2970 | pending_bios = &device->pending_bios; | 2970 | pending_bios = &device->pending_bios; |
