]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: core: Use a structure member to track the SCSI command submitter
authorBart Van Assche <bvanassche@acm.org>
Thu, 7 Oct 2021 20:27:56 +0000 (13:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:12:31 +0000 (15:12 +0100)
commitf2d30198c0530b8da155697d8723e19ac72c15fe
tree4712e35173789cc46d51fc96740e020e06bf7f34
parentdf83ca8e986d0285974dfa510973191547dcd173
scsi: core: Use a structure member to track the SCSI command submitter

[ Upstream commit bf23e619039d360d503b7282d030daf2277a5d47 ]

Conditional statements are faster than indirect calls. Use a structure
member to track the SCSI command submitter such that later patches can call
scsi_done(scmd) instead of scmd->scsi_done(scmd).

The asymmetric behavior that scsi_send_eh_cmnd() sets the submission
context to the SCSI error handler and that it does not restore the
submission context to the SCSI core is retained.

Link: https://lore.kernel.org/r/20211007202923.2174984-2-bvanassche@acm.org
Cc: Hannes Reinecke <hare@suse.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stable-dep-of: 066c5b46b6ea ("scsi: core: Always send batch on reset or error handling command")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_priv.h
include/scsi/scsi_cmnd.h