mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[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 <[email protected]> Signed-off-by: James Bottomley <[email protected]>
This commit is contained in:
parent
45d7f0cc58
commit
2a8cfad06e
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue