aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 15:31:52 -0400
committerJens Axboe <axboe@fb.com>2016-06-07 15:41:38 -0400
commit37226b2111b0ef7903ceedb8597e2203d7d6dc09 (patch)
tree8846b2212ac7018a4120ed8e2051cebec8d400cb /fs/btrfs/disk-io.c
parent1f7ad75b13b5bd50680d5d3ccff7807e15620448 (diff)
btrfs: use bio op accessors
This should be the easier cases to convert btrfs to bio_set_op_attrs/bio_op. They are mostly just cut and replace type of changes. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 11033ce82f8a..93278c2f6af2 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -727,7 +727,7 @@ static void end_workqueue_bio(struct bio *bio)
727 fs_info = end_io_wq->info; 727 fs_info = end_io_wq->info;
728 end_io_wq->error = bio->bi_error; 728 end_io_wq->error = bio->bi_error;
729 729
730 if (bio->bi_rw & REQ_WRITE) { 730 if (bio_op(bio) == REQ_OP_WRITE) {
731 if (end_io_wq->metadata == BTRFS_WQ_ENDIO_METADATA) { 731 if (end_io_wq->metadata == BTRFS_WQ_ENDIO_METADATA) {
732 wq = fs_info->endio_meta_write_workers; 732 wq = fs_info->endio_meta_write_workers;
733 func = btrfs_endio_meta_write_helper; 733 func = btrfs_endio_meta_write_helper;
@@ -873,7 +873,7 @@ int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct inode *inode,
873 873
874 atomic_inc(&fs_info->nr_async_submits); 874 atomic_inc(&fs_info->nr_async_submits);
875 875
876 if (rw & REQ_SYNC) 876 if (bio->bi_rw & REQ_SYNC)
877 btrfs_set_work_high_priority(&async->work); 877 btrfs_set_work_high_priority(&async->work);
878 878
879 btrfs_queue_work(fs_info->workers, &async->work); 879 btrfs_queue_work(fs_info->workers, &async->work);
@@ -951,7 +951,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
951 int async = check_async_write(inode, bio_flags); 951 int async = check_async_write(inode, bio_flags);
952 int ret; 952 int ret;
953 953
954 if (!(rw & REQ_WRITE)) { 954 if (bio_op(bio) != REQ_OP_WRITE) {
955 /* 955 /*
956 * called for a read, do the setup so that checksum validation 956 * called for a read, do the setup so that checksum validation
957 * can happen in the async kernel threads 957 * can happen in the async kernel threads
@@ -3486,7 +3486,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait)
3486 3486
3487 bio->bi_end_io = btrfs_end_empty_barrier; 3487 bio->bi_end_io = btrfs_end_empty_barrier;
3488 bio->bi_bdev = device->bdev; 3488 bio->bi_bdev = device->bdev;
3489 bio->bi_rw = WRITE_FLUSH; 3489 bio_set_op_attrs(bio, REQ_OP_WRITE, WRITE_FLUSH);
3490 init_completion(&device->flush_wait); 3490 init_completion(&device->flush_wait);
3491 bio->bi_private = &device->flush_wait; 3491 bio->bi_private = &device->flush_wait;
3492 device->flush_bio = bio; 3492 device->flush_bio = bio;