diff mbox series

[2/4] scsi: sg: implement BLKSSZGET

Message ID 20200904200554.168979-2-tom.ty89@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/4] scsi: sg: fix BLKSECTGET ioctl | expand

Commit Message

Tom Yan Sept. 4, 2020, 8:05 p.m. UTC
Provide an ioctl to get the logical sector size so that the maximum
bytes per request can be derived.

Follow-up of the BLKSECTGET fix.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>
---
 drivers/scsi/sg.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Douglas Gilbert Sept. 5, 2020, 6:37 p.m. UTC | #1
On 2020-09-04 4:05 p.m., Tom Yan wrote:
> Provide an ioctl to get the logical sector size so that the maximum
> bytes per request can be derived.
> 
> Follow-up of the BLKSECTGET fix.
> 
> Signed-off-by: Tom Yan <tom.ty89@gmail.com>

Acked-by: Douglas Gilbert <dgilbert@interlog.com>

> ---
>   drivers/scsi/sg.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index e57831910228..0e3f084141a3 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -1118,6 +1118,8 @@ sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
>   		max_sectors = min_t(unsigned int, USHRT_MAX,
>   				    queue_max_sectors(sdp->device->request_queue));
>   		return put_user(max_sectors, ip);
> +	case BLKSSZGET:
> +		return put_user(queue_logical_block_size(sdp->device->request_queue), ip);
>   	case BLKTRACESETUP:
>   		return blk_trace_setup(sdp->device->request_queue,
>   				       sdp->disk->disk_name,
>
diff mbox series

Patch

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index e57831910228..0e3f084141a3 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1118,6 +1118,8 @@  sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
 		max_sectors = min_t(unsigned int, USHRT_MAX,
 				    queue_max_sectors(sdp->device->request_queue));
 		return put_user(max_sectors, ip);
+	case BLKSSZGET:
+		return put_user(queue_logical_block_size(sdp->device->request_queue), ip);
 	case BLKTRACESETUP:
 		return blk_trace_setup(sdp->device->request_queue,
 				       sdp->disk->disk_name,