Instead of storing the iSCSI task pointer and the session age in the SCSI pointer, use command-private variables. This patch prepares for removal of the SCSI pointer from struct scsi_cmnd. The list of iSCSI drivers has been obtained as follows: $ git grep -lw iscsi_host_alloc drivers/infiniband/ulp/iser/iscsi_iser.c drivers/scsi/be2iscsi/be_main.c drivers/scsi/bnx2i/bnx2i_iscsi.c drivers/scsi/cxgbi/libcxgbi.c drivers/scsi/iscsi_tcp.c drivers/scsi/libiscsi.c drivers/scsi/qedi/qedi_main.c drivers/scsi/qla4xxx/ql4_os.c include/scsi/libiscsi.h Note: it is not clear to me how the qla4xxx driver can work without this patch since it uses the scsi_cmnd::SCp.ptr member for two different purposes: - The qla4xxx driver uses this member to store a struct srb pointer. - libiscsi uses this member to store a struct iscsi_task pointer. Reviewed-by: Lee Duncan <lduncan@suse.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Cc: Chris Leech <cleech@redhat.com> Cc: Sagi Grimberg <sagi@grimberg.me> Cc: Nilesh Javali <njavali@marvell.com> Cc: Manish Rangankar <mrangankar@marvell.com> Cc: Karen Xie <kxie@chelsio.com> Cc: Ketan Mukadam <ketan.mukadam@broadcom.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> iscsi
Showing the changes to include (1 of 12 files). Show all
Unified · Split
| @@ -19,6 +19,7 @@ · 18 unmodified lines | |||
| 19 | #include <linux/refcount.h> | 19 | #include <linux/refcount.h> |
| 20 | #include <scsi/iscsi_proto.h> | 20 | #include <scsi/iscsi_proto.h> |
| 21 | #include <scsi/iscsi_if.h> | 21 | #include <scsi/iscsi_if.h> |
| 22 | #include <scsi/scsi_cmnd.h> | ||
| 22 | #include <scsi/scsi_transport_iscsi.h> | 23 | #include <scsi/scsi_transport_iscsi.h> |
| 23 | 24 | ||
| 24 | struct scsi_transport_template; | 25 | struct scsi_transport_template; |
| @@ -152,6 +153,17 @@ static inline bool iscsi_task_is_completed(struct iscsi_task *task) · 127 unmodified lines | |||
| 152 | task->state == ISCSI_TASK_ABRT_SESS_RECOV; | 153 | task->state == ISCSI_TASK_ABRT_SESS_RECOV; |
| 153 | } | 154 | } |
| 154 | 155 | ||
| 156 | /* Private data associated with struct scsi_cmnd. */ | ||
| 157 | struct iscsi_cmd { | ||
| 158 | struct iscsi_task *task; | ||
| 159 | int age; | ||
| 160 | }; | ||
| 161 | |||
| 162 | static inline struct iscsi_cmd *iscsi_cmd(struct scsi_cmnd *cmd) | ||
| 163 | { | ||
| 164 | return scsi_cmd_priv(cmd); | ||
| 165 | } | ||
| 166 | |||
| 155 | /* Connection's states */ | 167 | /* Connection's states */ |
| 156 | enum { | 168 | enum { |
| 157 | ISCSI_CONN_INITIAL_STAGE, | 169 | ISCSI_CONN_INITIAL_STAGE, |