btrfs: open-code bio_set_op_attrs
authorDavid Sterba <dsterba@suse.com>
Fri, 29 Jun 2018 08:56:53 +0000 (10:56 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:44 +0000 (13:12 +0200)
The helper is trivial and marked as deprecated.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/check-integrity.c
fs/btrfs/compression.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/raid56.c
fs/btrfs/scrub.c

index daf45472bef9140d75beae120038e47b9b6ae2b7..833cf3c35b4df8d0040bac23809dc7fcc20cef3d 100644 (file)
@@ -1629,7 +1629,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
                bio = btrfs_io_bio_alloc(num_pages - i);
                bio_set_dev(bio, block_ctx->dev->bdev);
                bio->bi_iter.bi_sector = dev_bytenr >> 9;
-               bio_set_op_attrs(bio, REQ_OP_READ, 0);
+               bio->bi_opf = REQ_OP_READ;
 
                for (j = i; j < num_pages; j++) {
                        ret = bio_add_page(bio, block_ctx->pagev[j],
index f48794a360689d97568754ed2d44a535b8ea925e..70dace47258baf9e4ec6046d3b9ec3e880f92806 100644 (file)
@@ -609,7 +609,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
        cb->len = bio->bi_iter.bi_size;
 
        comp_bio = btrfs_bio_alloc(bdev, cur_disk_byte);
-       bio_set_op_attrs (comp_bio, REQ_OP_READ, 0);
+       comp_bio->bi_opf = REQ_OP_READ;
        comp_bio->bi_private = cb;
        comp_bio->bi_end_io = end_compressed_bio_read;
        refcount_set(&cb->pending_bios, 1);
@@ -656,7 +656,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
                        }
 
                        comp_bio = btrfs_bio_alloc(bdev, cur_disk_byte);
-                       bio_set_op_attrs(comp_bio, REQ_OP_READ, 0);
+                       comp_bio->bi_opf = REQ_OP_READ;
                        comp_bio->bi_private = cb;
                        comp_bio->bi_end_io = end_compressed_bio_read;
 
index 4fc37e284a79929fcd5cf4ca8fa86e82d57c5372..fea015be4ce1a210ae0d5669551e5f122dade562 100644 (file)
@@ -2398,7 +2398,7 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
                                      start - page_offset(page),
                                      (int)phy_offset, failed_bio->bi_end_io,
                                      NULL);
-       bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
+       bio->bi_opf = REQ_OP_READ | read_mode;
 
        btrfs_debug(btrfs_sb(inode->i_sb),
                "Repair Read Error: submitting new read[%#x] to this_mirror=%d, in_validation=%d",
index ada8a698af100fa48da2e1f471b55dab54a61aa1..564ec00c765b56b2e70a9984251254888dee812a 100644 (file)
@@ -7861,7 +7861,7 @@ static blk_status_t dio_read_error(struct inode *inode, struct bio *failed_bio,
        isector >>= inode->i_sb->s_blocksize_bits;
        bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page,
                                pgoff, isector, repair_endio, repair_arg);
-       bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
+       bio->bi_opf = REQ_OP_READ | read_mode;
 
        btrfs_debug(BTRFS_I(inode)->root->fs_info,
                    "repair DIO read error: submitting new dio read[%#x] to this_mirror=%d, in_validation=%d",
index 42631079c492e41ed858fdaab08e6337e330c919..1a1b7d6c44cbcef262b6e5c95afddeaa757e2c56 100644 (file)
@@ -1330,7 +1330,7 @@ write_data:
 
                bio->bi_private = rbio;
                bio->bi_end_io = raid_write_end_io;
-               bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
+               bio->bi_opf = REQ_OP_WRITE;
 
                submit_bio(bio);
        }
@@ -1586,7 +1586,7 @@ static int raid56_rmw_stripe(struct btrfs_raid_bio *rbio)
 
                bio->bi_private = rbio;
                bio->bi_end_io = raid_rmw_end_io;
-               bio_set_op_attrs(bio, REQ_OP_READ, 0);
+               bio->bi_opf = REQ_OP_READ;
 
                btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56);
 
@@ -2130,7 +2130,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio)
 
                bio->bi_private = rbio;
                bio->bi_end_io = raid_recover_end_io;
-               bio_set_op_attrs(bio, REQ_OP_READ, 0);
+               bio->bi_opf = REQ_OP_READ;
 
                btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56);
 
@@ -2502,7 +2502,7 @@ submit_write:
 
                bio->bi_private = rbio;
                bio->bi_end_io = raid_write_end_io;
-               bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
+               bio->bi_opf = REQ_OP_WRITE;
 
                submit_bio(bio);
        }
@@ -2684,7 +2684,7 @@ static void raid56_parity_scrub_stripe(struct btrfs_raid_bio *rbio)
 
                bio->bi_private = rbio;
                bio->bi_end_io = raid56_parity_scrub_end_io;
-               bio_set_op_attrs(bio, REQ_OP_READ, 0);
+               bio->bi_opf = REQ_OP_READ;
 
                btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56);
 
index 67bb003323e72c496558e516ce640ef67024abf3..bf4f262f9a52e92bb3a32dae7ab330c9c53bab5a 100644 (file)
@@ -1842,7 +1842,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad,
                bio = btrfs_io_bio_alloc(1);
                bio_set_dev(bio, page_bad->dev->bdev);
                bio->bi_iter.bi_sector = page_bad->physical >> 9;
-               bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
+               bio->bi_opf = REQ_OP_WRITE;
 
                ret = bio_add_page(bio, page_good->page, PAGE_SIZE, 0);
                if (PAGE_SIZE != ret) {
@@ -1937,7 +1937,7 @@ again:
                bio->bi_end_io = scrub_wr_bio_end_io;
                bio_set_dev(bio, sbio->dev->bdev);
                bio->bi_iter.bi_sector = sbio->physical >> 9;
-               bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
+               bio->bi_opf = REQ_OP_WRITE;
                sbio->status = 0;
        } else if (sbio->physical + sbio->page_count * PAGE_SIZE !=
                   spage->physical_for_dev_replace ||
@@ -2337,7 +2337,7 @@ again:
                bio->bi_end_io = scrub_bio_end_io;
                bio_set_dev(bio, sbio->dev->bdev);
                bio->bi_iter.bi_sector = sbio->physical >> 9;
-               bio_set_op_attrs(bio, REQ_OP_READ, 0);
+               bio->bi_opf = REQ_OP_READ;
                sbio->status = 0;
        } else if (sbio->physical + sbio->page_count * PAGE_SIZE !=
                   spage->physical ||