diff options
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r-- | drivers/target/target_core_device.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 6cb9f8784327..25f33eb25337 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -835,7 +835,6 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib, struct block_device *bdev) { - struct request_queue *q = bdev_get_queue(bdev); int block_size = bdev_logical_block_size(bdev); if (!bdev_max_discard_sectors(bdev)) @@ -847,7 +846,7 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib, * Currently hardcoded to 1 in Linux/SCSI code.. */ attrib->max_unmap_block_desc_count = 1; - attrib->unmap_granularity = q->limits.discard_granularity / block_size; + attrib->unmap_granularity = bdev_discard_granularity(bdev) / block_size; attrib->unmap_granularity_alignment = bdev_discard_alignment(bdev) / block_size; return true; |