[COMMON] sd: change default chunk size
authorhgchu <hg.chu@samsung.com>
Sat, 21 Apr 2018 05:24:24 +0000 (14:24 +0900)
committerKim Gunho <gunho.kim@samsung.com>
Fri, 28 Jun 2019 14:46:32 +0000 (23:46 +0900)
This patch make default chunk size in /sys/block/sda/queue/max_sectors_kb
512 from 8(KB).

Change-Id: I7663df68b85eb64a8a94c9f553c3086a0ca33852
Signed-off-by: dukhyun kwon <d_hyun.kwon@samsung.com>
drivers/scsi/sd.c

index 0385eab82787e676b4e5857d15c93cb5f29784bf..5eabb5faa6c1f51f4ee97a4220da64d73b3cac88 100644 (file)
@@ -3198,10 +3198,10 @@ static int sd_revalidate_disk(struct gendisk *disk)
        dev_max = min_not_zero(dev_max, sdkp->max_xfer_blocks);
        q->limits.max_dev_sectors = logical_to_sectors(sdp, dev_max);
 
-       if (sd_validate_opt_xfer_size(sdkp, dev_max)) {
-               q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
-               rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
-       else
+       if (sd_validate_opt_xfer_size(sdkp, dev_max))
+               rw_max = q->limits.io_opt =
+                       sdkp->opt_xfer_blocks * sdp->sector_size;
+       else
                rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
                                      (sector_t)BLK_DEF_MAX_SECTORS);