summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2026-01-24 05:40:33 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2026-01-24 05:40:33 +0300
commit92da3818aaf6dd9c49ef8fdc39c024c76b52cba8 (patch)
tree8710b07a97dc448f3fb1e20c221ccfd3defae90a /include
parenta9e03ec01ef2633288fd1b506980f54ae41c5a85 (diff)
parent0db3f51839fe703173966f34a4327e3a0c7cc089 (diff)
downloadlinux-92da3818aaf6dd9c49ef8fdc39c024c76b52cba8.tar.xz
Merge patch series "Change the return type of the .queuecommand() callback"
Bart Van Assche <bvanassche@acm.org> says: Hi Martin, Most but not all .queuecommand() implementations return a SCSI_MLQUEUE_* constant. This affects code readability: in order to understand what happens if a .queuecommand() function returns a value that is not a SCSI_MLQUEUE_* constant, one has to read the scsi_dispatch_cmd() implementation and check how other values are handled. Hence this patch series that changes the return type of the .queuecommand() callback and also of the implementations of this callback. Please consider this patch series for the next merge window. Thanks, Bart. Link: https://patch.msgid.link/20260115210357.2501991-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/libata.h3
-rw-r--r--include/scsi/libfc.h3
-rw-r--r--include/scsi/libiscsi.h3
-rw-r--r--include/scsi/libsas.h3
-rw-r--r--include/scsi/scsi_host.h12
5 files changed, 16 insertions, 8 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 39534fafa36a..44117814d672 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1150,7 +1150,8 @@ extern int ata_scsi_ioctl(struct scsi_device *dev, unsigned int cmd,
#else
#define ATA_SCSI_COMPAT_IOCTL /* empty */
#endif
-extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd);
+extern enum scsi_qc_status ata_scsi_queuecmd(struct Scsi_Host *h,
+ struct scsi_cmnd *cmd);
#if IS_REACHABLE(CONFIG_ATA)
bool ata_scsi_dma_need_drain(struct request *rq);
#else
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 183d9fd50d2d..be0ffe1e3395 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -959,7 +959,8 @@ void fc_fcp_destroy(struct fc_lport *);
/*
* SCSI INTERACTION LAYER
*****************************/
-int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
+enum scsi_qc_status fc_queuecommand(struct Scsi_Host *shost,
+ struct scsi_cmnd *cmnd);
int fc_eh_abort(struct scsi_cmnd *);
int fc_eh_device_reset(struct scsi_cmnd *);
int fc_eh_host_reset(struct scsi_cmnd *);
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 7282555adfd5..3d765c77bcd9 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -392,7 +392,8 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);
extern int iscsi_eh_recover_target(struct scsi_cmnd *sc);
extern int iscsi_eh_session_reset(struct scsi_cmnd *sc);
extern int iscsi_eh_device_reset(struct scsi_cmnd *sc);
-extern int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc);
+extern enum scsi_qc_status iscsi_queuecommand(struct Scsi_Host *host,
+ struct scsi_cmnd *sc);
extern enum scsi_timeout_action iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc);
/*
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index a0635b128d7a..e76f5744941b 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -689,7 +689,8 @@ extern void sas_suspend_ha(struct sas_ha_struct *sas_ha);
int sas_phy_reset(struct sas_phy *phy, int hard_reset);
int sas_phy_enable(struct sas_phy *phy, int enable);
-extern int sas_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
+extern enum scsi_qc_status sas_queuecommand(struct Scsi_Host *host,
+ struct scsi_cmnd *cmd);
extern int sas_target_alloc(struct scsi_target *);
int sas_sdev_configure(struct scsi_device *dev, struct queue_limits *lim);
extern int sas_change_queue_depth(struct scsi_device *, int new_depth);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index e87cf7eadd26..f6e12565a81d 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -84,13 +84,15 @@ struct scsi_host_template {
*
* STATUS: REQUIRED
*/
- int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *);
+ enum scsi_qc_status (*queuecommand)(struct Scsi_Host *,
+ struct scsi_cmnd *);
/*
* Queue a reserved command (BLK_MQ_REQ_RESERVED). The .queuecommand()
* documentation also applies to the .queue_reserved_command() callback.
*/
- int (*queue_reserved_command)(struct Scsi_Host *, struct scsi_cmnd *);
+ enum scsi_qc_status (*queue_reserved_command)(struct Scsi_Host *,
+ struct scsi_cmnd *);
/*
* The commit_rqs function is used to trigger a hardware
@@ -525,10 +527,12 @@ struct scsi_host_template {
*
*/
#define DEF_SCSI_QCMD(func_name) \
- int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \
+ enum scsi_qc_status func_name(struct Scsi_Host *shost, \
+ struct scsi_cmnd *cmd) \
{ \
unsigned long irq_flags; \
- int rc; \
+ enum scsi_qc_status rc; \
+ \
spin_lock_irqsave(shost->host_lock, irq_flags); \
rc = func_name##_lck(cmd); \
spin_unlock_irqrestore(shost->host_lock, irq_flags); \