Re: [PATCH v5 3/6] scsi: core: Pass the SCSI host pointer directly to scanning functions

John Garry <[email protected]>
Newsgroups org.kernel.vger.linux-scsi
Organization Oracle Corporation
Message-ID <[email protected]>
On 05/08/2026 22:36, Bart Van Assche wrote:
> In the functions scsi_probe_and_add_lun(), scsi_sequential_lun_scan(),
> scsi_report_lun_scan() and __scsi_scan_target() the SCSI host pointer is
> derived from the SCSI target pointer. Pass the SCSI host pointer
> directly.
> 
> This patch prepares for enabling lock context analysis. With this patch
> applied, lock context annotations can refer to the SCSI host pointer
> directly, e.g. __must_hold(&shost->scan_mutex). Without this patch, the
> following annotation would have to be used:
> 	__must_hold(&dev_to_shost(starget->dev.parent)->scan_mutex)
> Additionally, in code that locks shost->scan_mutex, the following would
> have to be added to help the compiler understand that shost ==
> dev_to_shost(starget->dev.parent):
> 	__assume_ctx_lock(&dev_to_shost(starget->dev.parent)->scan_mutex);
> __assume_ctx_lock() statements should be avoided if there is a good
> alternative. Hence this patch. No functionality has been changed.
> 
> Signed-off-by: Bart Van Assche<[email protected]>

Reviewed-by: John Garry <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.