Alan Stern 44ec95425c [SCSI] sg: cap reserved_size values at max_sectors
This patch (as857) modifies the SG_GET_RESERVED_SIZE and
SG_SET_RESERVED_SIZE ioctls in the sg driver, capping the values at
the device's request_queue's max_sectors value.  This will permit
cdrecord to obtain a legal value for the maximum transfer length,
fixing Bugzilla #7026.

The patch also caps the initial reserved_size value.  There's no
reason to have a reserved buffer larger than max_sectors, since it
would be impossible to use the extra space.

The corresponding ioctls in the block layer are modified similarly,
and the initial value for the reserved_size is set as large as
possible.  This will effectively make it default to max_sectors.
Note that the actual value is meaningless anyway, since block devices
don't have a reserved buffer.

Finally, the BLKSECTGET ioctl is added to sg, so that there will be a
uniform way for users to determine the actual max_sectors value for
any raw SCSI transport.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-17 18:09:56 -04:00
..
2007-04-01 10:10:04 -05:00
2006-09-12 17:12:31 -05:00
2006-09-12 17:12:31 -05:00
2007-02-07 18:32:18 -05:00
2007-04-01 10:12:51 -05:00
2006-08-06 15:59:26 -05:00
2006-11-15 16:41:27 -06:00
2006-09-12 17:12:31 -05:00
2007-02-17 02:40:24 +01:00
2006-11-22 14:57:56 +00:00
2007-04-01 11:19:12 -05:00
2007-04-01 11:19:39 -05:00
2006-09-23 15:33:43 -05:00
2007-03-11 11:28:09 -05:00
2007-04-17 18:03:31 -04:00
2006-12-05 10:25:35 -06:00
2006-09-12 17:12:31 -05:00
2006-11-30 05:24:39 +01:00
2006-11-22 14:57:56 +00:00
2006-11-22 14:57:56 +00:00
2007-01-27 09:28:58 -06:00
2007-02-09 09:14:07 -08:00
2006-11-22 14:57:56 +00:00
2007-03-11 11:17:49 -05:00
2007-01-03 16:57:38 -06:00
2007-01-13 13:49:58 -06:00
2006-11-15 16:43:50 -06:00