summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_device.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-04-15 06:52:33 +0200
committerJens Axboe <axboe@kernel.dk>2022-04-17 19:49:58 -0600
commit817e8b51eb3d927ce6d56ecf9f48bc3c5b26168b (patch)
tree722bac3bc07a22d83406554e9917feef3b374eeb /drivers/target/target_core_device.c
parent179d8609d8424529e95021df939ed7b0b82b37f1 (diff)
downloadlinux-817e8b51eb3d927ce6d56ecf9f48bc3c5b26168b.tar.gz
linux-817e8b51eb3d927ce6d56ecf9f48bc3c5b26168b.tar.bz2
linux-817e8b51eb3d927ce6d56ecf9f48bc3c5b26168b.zip
target: pass a block_device to target_configure_unmap_from_queue
The SCSI target drivers is a consumer of the block layer and shoul d generally work on struct block_device. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://lore.kernel.org/r/20220415045258.199825-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r--drivers/target/target_core_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb..3a1ec705cd80 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;