diff options
author | Christoph Hellwig <hch@lst.de> | 2020-10-05 10:41:28 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-10-07 21:48:27 -0400 |
commit | 7007e9dd56767a95de0947b3f7599bcc2f21687f (patch) | |
tree | 2a3419a1303859aaadab9c3d22fa762bdc362332 /include/scsi/scsi_cmnd.h | |
parent | 5843cc3d5acd8e6654eb2477f3e48c30e3a2e4f7 (diff) |
scsi: core: Clean up allocation and freeing of sgtables
Rename scsi_init_io() to scsi_alloc_sgtables(), and ensure callers call
scsi_free_sgtables() to cleanup failures close to scsi_init_io() instead of
leaking it down the generic I/O submission path.
Link: https://lore.kernel.org/r/20201005084130.143273-9-hch@lst.de
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi/scsi_cmnd.h')
-rw-r--r-- | include/scsi/scsi_cmnd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index e76bac4d14c5..69ade4fb71aa 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -165,7 +165,8 @@ extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count, size_t *offset, size_t *len); extern void scsi_kunmap_atomic_sg(void *virt); -extern blk_status_t scsi_init_io(struct scsi_cmnd *cmd); +blk_status_t scsi_alloc_sgtables(struct scsi_cmnd *cmd); +void scsi_free_sgtables(struct scsi_cmnd *cmd); #ifdef CONFIG_SCSI_DMA extern int scsi_dma_map(struct scsi_cmnd *cmd); |