On 1/24/23 06:30, mwilck@xxxxxxxx wrote:
+/** + * scsi_device_put_nosleep - release a reference to a scsi_device + * @sdev: device to release a reference on. + * + * Description: Release a reference to the scsi_device and decrements the use + * count of the underlying LLDD module. This function may only be called from + * a call context where it is certain that the reference dropped is not the + * last one. + */
The above comment does not cover the call from scsi_device_put(). That could be addressed by adding the following text at the end of the above comment: " or from a context in which it is allowed to sleep". However, if that text would be added the function name ("scsi_device_put_nosleep()") would become confusing. How about open-coding scsi_device_put_nosleep() in scsi_device_put() to prevent this confusion?
Thanks, Bart.