Skip to content

Commit

Permalink
scsi: increase upper limit for max_sectors
Browse files Browse the repository at this point in the history
max_sectors in struct Scsi_Host specifies maximum number of sectors
allowed in a single SCSI command.  The data type of max_sectors is
unsigned short, so the maximum transfer length per SCSI command is
limited to less than 256MB in 4096-bytes sector size. (0xffff * 4096)

This commit increases the SCSI mid level's limitation for max_sectors
upto the block layer's limitation for max_hw_sectors by extending the
data type of max_sectors in struct Scsi_Host and scsi_host_template,
so that SCSI lower level drivers can specify more than 0xffff.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Akinobu Mita authored and Christoph Hellwig committed Jul 17, 2014
1 parent e430cbc commit 8ed5a4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/scsi/scsi_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ struct scsi_host_template {
/*
* Set this if the host adapter has limitations beside segment count.
*/
unsigned short max_sectors;
unsigned int max_sectors;

/*
* DMA scatter gather segment boundary limit. A segment crossing this
Expand Down Expand Up @@ -652,7 +652,7 @@ struct Scsi_Host {
short cmd_per_lun;
short unsigned int sg_tablesize;
short unsigned int sg_prot_tablesize;
short unsigned int max_sectors;
unsigned int max_sectors;
unsigned long dma_boundary;
/*
* Used to assign serial numbers to the cmds.
Expand Down

0 comments on commit 8ed5a4d

Please sign in to comment.