@@ -312,7 +312,8 @@ static void iblock_bio_done(struct bio *bio)
312
312
}
313
313
314
314
static struct bio *
315
- iblock_get_bio (struct se_cmd * cmd , sector_t lba , u32 sg_num , int rw )
315
+ iblock_get_bio (struct se_cmd * cmd , sector_t lba , u32 sg_num , int op ,
316
+ int op_flags )
316
317
{
317
318
struct iblock_dev * ib_dev = IBLOCK_DEV (cmd -> se_dev );
318
319
struct bio * bio ;
@@ -334,7 +335,7 @@ iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, int rw)
334
335
bio -> bi_private = cmd ;
335
336
bio -> bi_end_io = & iblock_bio_done ;
336
337
bio -> bi_iter .bi_sector = lba ;
337
- bio -> bi_rw = rw ;
338
+ bio_set_op_attrs ( bio , op , op_flags ) ;
338
339
339
340
return bio ;
340
341
}
@@ -480,7 +481,7 @@ iblock_execute_write_same(struct se_cmd *cmd)
480
481
goto fail ;
481
482
cmd -> priv = ibr ;
482
483
483
- bio = iblock_get_bio (cmd , block_lba , 1 , WRITE );
484
+ bio = iblock_get_bio (cmd , block_lba , 1 , REQ_OP_WRITE , 0 );
484
485
if (!bio )
485
486
goto fail_free_ibr ;
486
487
@@ -493,7 +494,8 @@ iblock_execute_write_same(struct se_cmd *cmd)
493
494
while (bio_add_page (bio , sg_page (sg ), sg -> length , sg -> offset )
494
495
!= sg -> length ) {
495
496
496
- bio = iblock_get_bio (cmd , block_lba , 1 , WRITE );
497
+ bio = iblock_get_bio (cmd , block_lba , 1 , REQ_OP_WRITE ,
498
+ 0 );
497
499
if (!bio )
498
500
goto fail_put_bios ;
499
501
@@ -679,8 +681,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
679
681
struct scatterlist * sg ;
680
682
u32 sg_num = sgl_nents ;
681
683
unsigned bio_cnt ;
682
- int rw = 0 ;
683
- int i ;
684
+ int i , op , op_flags = 0 ;
684
685
685
686
if (data_direction == DMA_TO_DEVICE ) {
686
687
struct iblock_dev * ib_dev = IBLOCK_DEV (dev );
@@ -689,18 +690,15 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
689
690
* Force writethrough using WRITE_FUA if a volatile write cache
690
691
* is not enabled, or if initiator set the Force Unit Access bit.
691
692
*/
693
+ op = REQ_OP_WRITE ;
692
694
if (test_bit (QUEUE_FLAG_FUA , & q -> queue_flags )) {
693
695
if (cmd -> se_cmd_flags & SCF_FUA )
694
- rw = WRITE_FUA ;
696
+ op_flags = WRITE_FUA ;
695
697
else if (!test_bit (QUEUE_FLAG_WC , & q -> queue_flags ))
696
- rw = WRITE_FUA ;
697
- else
698
- rw = WRITE ;
699
- } else {
700
- rw = WRITE ;
698
+ op_flags = WRITE_FUA ;
701
699
}
702
700
} else {
703
- rw = READ ;
701
+ op = REQ_OP_READ ;
704
702
}
705
703
706
704
ibr = kzalloc (sizeof (struct iblock_req ), GFP_KERNEL );
@@ -714,7 +712,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
714
712
return 0 ;
715
713
}
716
714
717
- bio = iblock_get_bio (cmd , block_lba , sgl_nents , rw );
715
+ bio = iblock_get_bio (cmd , block_lba , sgl_nents , op , op_flags );
718
716
if (!bio )
719
717
goto fail_free_ibr ;
720
718
@@ -738,7 +736,8 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
738
736
bio_cnt = 0 ;
739
737
}
740
738
741
- bio = iblock_get_bio (cmd , block_lba , sg_num , rw );
739
+ bio = iblock_get_bio (cmd , block_lba , sg_num , op ,
740
+ op_flags );
742
741
if (!bio )
743
742
goto fail_put_bios ;
744
743
0 commit comments