On 04/11/2022 23:18, Mike Christie wrote:
- req_flags_t rq_flags, int *resid)
+int __scsi_exec_req(const struct scsi_exec_args *args)
nit: I would expect a req to be passed based on the name, like
blk_execute_rq()
{
struct request *req;
struct scsi_cmnd *scmd;
int ret;
- req = scsi_alloc_request(sdev->request_queue,
- data_direction == DMA_TO_DEVICE ?
- REQ_OP_DRV_OUT : REQ_OP_DRV_IN,
- rq_flags & RQF_PM ? BLK_MQ_REQ_PM : 0);
+ req = scsi_alloc_request(args->sdev->request_queue,
+ args->data_dir == DMA_TO_DEVICE ?
+ REQ_OP_DRV_OUT : REQ_OP_DRV_IN,
Did you ever consider just putting the scsi_alloc_request() opf arg in
struct scsi_exec_args (rather than data_dir), i.e. have the caller
evaluate? We already do it in other callers to scsi_alloc_request().
Current method means a store (in scsi_exec_args struct), a load, a
comparison, and a mov value to register whose value depends on
comparison. That's most relevant on performance being a concern.
Thanks,
John