diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index 537a1a5f5..c978bdbc1 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -1163,16 +1163,18 @@ int write_data(struct iscsi_conn *conn) sock = conn->sock; flags = MSG_DONTWAIT; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) + sock_sendpage = sock_no_sendpage; +#endif if (sg != write_cmnd->rsp_sg && (!parent_req->scst_cmd || parent_req->scst_state == ISCSI_CMD_STATE_AEN || - !scst_cmd_get_dh_data_buff_alloced(parent_req->scst_cmd))) + !scst_cmd_get_dh_data_buff_alloced(parent_req->scst_cmd))) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) flags |= MSG_SPLICE_PAGES; #else sock_sendpage = sock->ops->sendpage; - else - sock_sendpage = sock_no_sendpage; #endif + } sg_size = size; diff --git a/scst/src/dev_handlers/scst_vdisk_main.c b/scst/src/dev_handlers/scst_vdisk_main.c index a60c00751..e22b93b3d 100644 --- a/scst/src/dev_handlers/scst_vdisk_main.c +++ b/scst/src/dev_handlers/scst_vdisk_main.c @@ -239,10 +239,11 @@ static struct file *vdev_open_fd(const struct scst_vdisk_dev *virt_dev, const ch #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) static void vdev_flush_end_io(struct bio *bio, int error) -{ #else static void vdev_flush_end_io(struct bio *bio) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && \ !defined(CONFIG_SUSE_KERNEL) int error = bio->bi_error; @@ -2709,10 +2710,11 @@ struct bio_priv_sync { #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) static void blockio_end_sync_io(struct bio *bio, int error) -{ #else static void blockio_end_sync_io(struct bio *bio) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && \ !defined(CONFIG_SUSE_KERNEL) int error = bio->bi_error; @@ -5534,10 +5536,11 @@ static inline void blockio_check_finish(struct scst_blockio_work *blockio_work) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) static void blockio_endio(struct bio *bio, int error) -{ #else static void blockio_endio(struct bio *bio) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && \ !defined(CONFIG_SUSE_KERNEL) int error = bio->bi_error; @@ -5790,14 +5793,15 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua) blockio_work->cmd = cmd; - if (q) + if (q) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) max_nr_vecs = BIO_MAX_VECS; #else max_nr_vecs = min(bio_get_nr_vecs(bdev), BIO_MAX_VECS); #endif - else + } else { max_nr_vecs = 1; + } need_new_bio = 1; diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index e661e80bc..6295f1dc1 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8201,10 +8201,11 @@ static inline void scst_free_bio(struct bio *bio); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) static void blk_bio_map_kern_endio(struct bio *bio, int err) -{ #else static void blk_bio_map_kern_endio(struct bio *bio) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && \ !defined(CONFIG_SUSE_KERNEL) int err = bio->bi_error;