Re: [PATCH v6 03/35] scsi: Add struct for args to execution functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/10/22 5:15 AM, John Garry wrote:
> 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()
> 

We have scsi_exeucute_req now which works like scsi_exec_req. I carried it over
because it seemed nice that it reflects we are executing a request vs something
like a TMF. I don't care either way if people have a preference.


>>   {
>>       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().

I did, but this part of the patches just convert us to the args struct
use. I tried to not change the types to keep the patchset down.

I'll change the types in another patchset, but I think it's better to
do in a separate patchset because I think we can do some more cleanup.
The users that use scsi_allocate_request are kind of a mix match mess
in that we use the scsi helper to allocate the request and scsi_cmnd,
then setup the request directly and then use the blk_execute_rq helper.
So I was thinking they use the flags directly since they are using the
block layer APIs where the scsi_execute* users are trying to use a SCSI
interface where the DMA values are also used (LLDs use DMA flags, ULDs
use a mix because they convert between block and SCSI, and scsi-ml uses
both as well).



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux