@@ -230,14 +230,12 @@ static void iblock_unplug_device(struct se_dev_plug *se_plug)
230
230
clear_bit (IBD_PLUGF_PLUGGED , & ib_dev_plug -> flags );
231
231
}
232
232
233
- static unsigned long long iblock_emulate_read_cap_with_block_size (
234
- struct se_device * dev ,
235
- struct block_device * bd ,
236
- struct request_queue * q )
233
+ static sector_t iblock_get_blocks (struct se_device * dev )
237
234
{
238
- u32 block_size = bdev_logical_block_size (bd );
235
+ struct iblock_dev * ib_dev = IBLOCK_DEV (dev );
236
+ u32 block_size = bdev_logical_block_size (ib_dev -> ibd_bd );
239
237
unsigned long long blocks_long =
240
- div_u64 (bdev_nr_bytes (bd ), block_size ) - 1 ;
238
+ div_u64 (bdev_nr_bytes (ib_dev -> ibd_bd ), block_size ) - 1 ;
241
239
242
240
if (block_size == dev -> dev_attrib .block_size )
243
241
return blocks_long ;
@@ -829,15 +827,6 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
829
827
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE ;
830
828
}
831
829
832
- static sector_t iblock_get_blocks (struct se_device * dev )
833
- {
834
- struct iblock_dev * ib_dev = IBLOCK_DEV (dev );
835
- struct block_device * bd = ib_dev -> ibd_bd ;
836
- struct request_queue * q = bdev_get_queue (bd );
837
-
838
- return iblock_emulate_read_cap_with_block_size (dev , bd , q );
839
- }
840
-
841
830
static sector_t iblock_get_alignment_offset_lbas (struct se_device * dev )
842
831
{
843
832
struct iblock_dev * ib_dev = IBLOCK_DEV (dev );
0 commit comments