The write_same and write_zeroes limits for SCSI are effectively the
same, so the current code works just fine. But we plan to remove
REQ_OP_WRITE_SAME support, so switch to quering the write zeroes
limit for a zeroing WRITE SAME operation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
struct device *dev = &cfg->dev->dev;
const u32 s = ilog2(sdev->sector_size) - 9;
const u32 to = sdev->request_queue->rq_timeout;
- const u32 ws_limit = blk_queue_get_max_sectors(sdev->request_queue,
- REQ_OP_WRITE_SAME) >> s;
+ const u32 ws_limit =
+ sdev->request_queue->limits.max_write_zeroes_sectors >> s;
cmd_buf = kzalloc(CMD_BUFSIZE, GFP_KERNEL);
scsi_cmd = kzalloc(MAX_COMMAND_SIZE, GFP_KERNEL);