Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154014
b: refs/heads/master
c: d11b691
h: refs/heads/master
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Jun 21, 2009
1 parent ba41d1a commit 3d3845d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3821d768912a47ddbd6cab52943a8284df88003c
refs/heads/master: d11b6916961d6ec7d7215332cbbe9feec086721d
24 changes: 24 additions & 0 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,29 @@ void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer)
return;
}

/**
* sd_read_block_limits - Query disk device for preferred I/O sizes.
* @disk: disk to query
*/
static void sd_read_block_limits(struct scsi_disk *sdkp)
{
unsigned int sector_sz = sdkp->device->sector_size;
char *buffer;

/* Block Limits VPD */
buffer = scsi_get_vpd_page(sdkp->device, 0xb0);

if (buffer == NULL)
return;

blk_queue_io_min(sdkp->disk->queue,
get_unaligned_be16(&buffer[6]) * sector_sz);
blk_queue_io_opt(sdkp->disk->queue,
get_unaligned_be32(&buffer[12]) * sector_sz);

kfree(buffer);
}

/**
* sd_read_block_characteristics - Query block dev. characteristics
* @disk: disk to query
Expand Down Expand Up @@ -1854,6 +1877,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
*/
if (sdkp->media_present) {
sd_read_capacity(sdkp, buffer);
sd_read_block_limits(sdkp);
sd_read_block_characteristics(sdkp);
sd_read_write_protect_flag(sdkp, buffer);
sd_read_cache_type(sdkp, buffer);
Expand Down

0 comments on commit 3d3845d

Please sign in to comment.