mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 21:56:31 +00:00
scst, ib_srpt: Add support for kernel version v5.1 (merge r8064 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@8486 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -8496,6 +8496,7 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data,
|
||||
}
|
||||
|
||||
if (cmd->data_direction == SCST_DATA_BIDI) {
|
||||
#ifdef QUEUE_FLAG_BIDI
|
||||
struct request *next_rq;
|
||||
|
||||
if (!test_bit(QUEUE_FLAG_BIDI, &q->queue_flags)) {
|
||||
@@ -8518,6 +8519,9 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data,
|
||||
goto out_free_unmap;
|
||||
}
|
||||
rq->next_rq = next_rq;
|
||||
#else
|
||||
return -EOPNOTSUPP;
|
||||
#endif
|
||||
} else {
|
||||
rq = blk_map_kern_sg(q, cmd->sg, cmd->sg_cnt, gfp, reading);
|
||||
if (IS_ERR(rq)) {
|
||||
@@ -8558,6 +8562,7 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data,
|
||||
out:
|
||||
return res;
|
||||
|
||||
#ifdef QUEUE_FLAG_BIDI
|
||||
out_free_unmap:
|
||||
{
|
||||
struct bio *bio = rq->bio, *b;
|
||||
@@ -8580,6 +8585,7 @@ out_free_unmap:
|
||||
rq->bio = NULL;
|
||||
|
||||
blk_put_request(rq);
|
||||
#endif
|
||||
|
||||
out_free_sioc:
|
||||
kmem_cache_free(scsi_io_context_cache, sioc);
|
||||
|
||||
@@ -1076,7 +1076,8 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *scmd,
|
||||
#endif
|
||||
|
||||
if (scsi_bidi_cmnd(scmd)) {
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24)
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
/* Some of these symbols are only defined after 2.6.24 */
|
||||
dir = SCST_DATA_BIDI;
|
||||
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(scmd));
|
||||
@@ -1243,7 +1244,7 @@ static int scst_local_slave_alloc(struct scsi_device *sdev)
|
||||
#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6
|
||||
queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdev->request_queue);
|
||||
#endif
|
||||
#else
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
blk_queue_flag_set(QUEUE_FLAG_BIDI, sdev->request_queue);
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -3110,7 +3110,7 @@ static int srpt_map_sg_to_ib_sge(struct srpt_rdma_ch *ch,
|
||||
struct srpt_send_ioctx *ioctx,
|
||||
struct scst_cmd *cmd)
|
||||
{
|
||||
struct ib_device *dev;
|
||||
struct ib_device *dev __maybe_unused;
|
||||
struct scatterlist *sg, *cur_sg;
|
||||
int sg_cnt;
|
||||
scst_data_direction dir;
|
||||
|
||||
Reference in New Issue
Block a user