Re: [PATCH 2/9] scsi: add scsi_host_flush_commands() helper

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

 



On 11/18/19 11:57 PM, Bart Van Assche wrote:
> On 11/18/19 1:22 AM, Hannes Reinecke wrote:
>> +/**
>> + * scsi_host_flush_commands -- Terminate all running commands
>> + * @shost:    Scsi Host on which commands should be terminated
>> + * @status:    Status to be set for the terminated commands
>> + */
>> +static bool flush_cmds_iter(struct request *rq, void *data, bool
>> reserved)
>> +{
>> +    struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq);
>> +    int status = *(int *)data;
>> +
>> +    if (reserved)
>> +        return true;
>> +    scmd->result = status << 16;
>> +    scmd->scsi_done(scmd);
>> +    return true;
>> +}
>> +
>> +void scsi_host_flush_commands(struct Scsi_Host *shost, int status)
>> +{
>> +    blk_mq_tagset_busy_iter(&shost->tag_set, flush_cmds_iter, &status);
>> +}
> 
> Should the kernel-doc comment be moved from the static function to the
> exported function? Please also add a comment that it is only safe to
> call scsi_host_flush_commands() from inside a LLD reset handler.
> 
I'd rather say that concurrent I/O submission must be prevented from the
caller. But yes, will be updating the comments.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      Teamlead Storage & Networking
hare@xxxxxxx			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer



[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