diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2011-05-18 08:31:07 +0400 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-24 20:38:15 +0400 |
commit | 2a8cfad06ebbb68e8c113a39bdd653297fb9369c (patch) | |
tree | 5c1aea3f2d3a6a04116775bef20d405fb084e500 /drivers/scsi/sd.c | |
parent | 45d7f0cc58183062adea0a1de3d8cba768134138 (diff) | |
download | linux-2a8cfad06ebbb68e8c113a39bdd653297fb9369c.tar.xz |
[SCSI] sd: Unmap discard alignment needs to be converted to bytes
The block layer discard alignment is reported in bytes, not in units of
the logical block size.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index bd0806e64e85..1c69c14be0cd 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -490,7 +490,8 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode) unsigned int max_blocks = 0; q->limits.discard_zeroes_data = sdkp->lbprz; - q->limits.discard_alignment = sdkp->unmap_alignment; + q->limits.discard_alignment = sdkp->unmap_alignment * + logical_block_size; q->limits.discard_granularity = max(sdkp->physical_block_size, sdkp->unmap_granularity * logical_block_size); |