scst/include/backport.h: Move bsg_job_sense() under scsi related backport

Preparing for backport Linux Kernel v5.18 scsi related changes.

This patch does not change any functionality.
This commit is contained in:
Gleb Chesnokov
2022-03-29 14:53:42 +03:00
parent 5d23bc00ad
commit e747372ef3

View File

@@ -201,34 +201,6 @@ void blk_execute_rq_nowait_backport(struct request *rq, bool at_head,
#define blk_execute_rq_nowait blk_execute_rq_nowait_backport
#endif
/* <linux/bsg-lib.h> */
/*
* Note: the function bsg_job_sense() exists only in SCST but not in any
* upstream kernel.
*/
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) && \
!defined(CONFIG_SUSE_KERNEL)) || \
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) && \
defined(CONFIG_SUSE_KERNEL))
static inline void *bsg_job_sense(struct fc_bsg_job *job)
{
return job->req->sense;
}
#else
static inline void *bsg_job_sense(struct bsg_job *job)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
return job->req->sense;
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && \
!defined(CONFIG_SUSE_KERNEL)
return scsi_req(job->req)->sense;
#else
return scsi_req(blk_mq_rq_from_pdu(job))->sense;
#endif
}
#endif
/* <linux/byteorder/generic.h> */
/*
* See also f2f2efb807d3 ("byteorder: Move {cpu_to_be32, be32_to_cpu}_array()
@@ -1547,6 +1519,34 @@ static inline void scsi_req_init(struct request *rq)
}
#endif
/* <linux/bsg-lib.h> */
/*
* Note: the function bsg_job_sense() exists only in SCST but not in any
* upstream kernel.
*/
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) && \
!defined(CONFIG_SUSE_KERNEL)) || \
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) && \
defined(CONFIG_SUSE_KERNEL))
static inline void *bsg_job_sense(struct fc_bsg_job *job)
{
return job->req->sense;
}
#else
static inline void *bsg_job_sense(struct bsg_job *job)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
return job->req->sense;
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && \
!defined(CONFIG_SUSE_KERNEL)
return scsi_req(job->req)->sense;
#else
return scsi_req(blk_mq_rq_from_pdu(job))->sense;
#endif
}
#endif
/* <scsi/scsi_transport_fc.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && \