From: Marco Sanvido Date: Fri, 20 Jan 2012 23:49:27 +0000 (-0800) Subject: target: Fix iblock se_dev_attrib.unmap_granularity X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7347b5ff7090b2b399b7921a266255cd55bbd78f;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git target: Fix iblock se_dev_attrib.unmap_granularity The block layer keeps q->limits.discard_granularity in bytes, but iblock (and the SCSI Block Limits VPD page) keep unmap_granularity in blocks. Report the correct value when exporting block devices by dividing to convert bytes to blocks. Signed-off-by: Roland Dreier Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 628e877381d8..d43d5eb5ed20 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -181,7 +181,7 @@ static struct se_device *iblock_create_virtdevice( */ dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count = 1; dev->se_sub_dev->se_dev_attrib.unmap_granularity = - q->limits.discard_granularity; + q->limits.discard_granularity >> 9; dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment = q->limits.discard_alignment;