block: Consolidate phys_segment and hw_segment limits
Except for SCSI no device drivers distinguish between physical and hardware segment limits. Consolidate the two into a single segment limit. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:

committed by
Jens Axboe

parent
086fa5ff08
commit
8a78362c4e
@@ -287,8 +287,7 @@ sg_open(struct inode *inode, struct file *filp)
|
||||
if (list_empty(&sdp->sfds)) { /* no existing opens on this device */
|
||||
sdp->sgdebug = 0;
|
||||
q = sdp->device->request_queue;
|
||||
sdp->sg_tablesize = min(queue_max_hw_segments(q),
|
||||
queue_max_phys_segments(q));
|
||||
sdp->sg_tablesize = queue_max_segments(q);
|
||||
}
|
||||
if ((sfp = sg_add_sfp(sdp, dev)))
|
||||
filp->private_data = sfp;
|
||||
@@ -1376,8 +1375,7 @@ static Sg_device *sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
|
||||
sdp->device = scsidp;
|
||||
INIT_LIST_HEAD(&sdp->sfds);
|
||||
init_waitqueue_head(&sdp->o_excl_wait);
|
||||
sdp->sg_tablesize = min(queue_max_hw_segments(q),
|
||||
queue_max_phys_segments(q));
|
||||
sdp->sg_tablesize = queue_max_segments(q);
|
||||
sdp->index = k;
|
||||
kref_init(&sdp->d_ref);
|
||||
|
||||
|
Reference in New Issue
Block a user