diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 69e442e12..edf9d3e97 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -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); diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 1be668940..92e584247 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -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 diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 917d9a99f..1f8790fde 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -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;