From 256d695afaaf8c9c99e31f633825e725cda64a5a Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Thu, 7 Nov 2024 10:45:36 +0300 Subject: [PATCH] scst: Port to Linux kernel v6.12 Support for the following changes in the Linux kernel v6.12: - 5f60d5f6bbc1 ("move asm/unaligned.h to linux/unaligned.h") - cb787f4ac0c2 ("[tree-wide] finally take no_llseek out") --- fcst/ft_sess.c | 1 - iscsi-scst/include/iscsit_transport.h | 1 - iscsi-scst/kernel/iscsi.c | 1 - iscsi-scst/kernel/isert-scst/isert_login.c | 4 ++++ qla2x00t-32gbit/qla2x00-target/qla_tgt.c | 1 - qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c | 1 - qla2x00t-32gbit/qla_def.h | 5 +++++ qla2x00t-32gbit/qla_dsd.h | 7 +++++++ qla2x00t-32gbit/qla_target.c | 1 - qla2x00t-32gbit/qla_target.h | 2 -- qla2x00t/qla2x00-target/qla2x00t.c | 1 - scst/include/backport.h | 6 +++++- scst/include/scst.h | 6 +++++- scst/src/dev_handlers/scst_cdrom.c | 1 - scst/src/dev_handlers/scst_disk.c | 1 - scst/src/dev_handlers/scst_modisk.c | 1 - scst/src/dev_handlers/scst_tape.c | 1 - scst/src/dev_handlers/scst_vdisk.c | 1 - scst/src/scst_copy_mgr.c | 2 -- scst/src/scst_lib.c | 1 - scst/src/scst_pres.c | 1 - scst/src/scst_tg.c | 1 - 22 files changed, 26 insertions(+), 21 deletions(-) diff --git a/fcst/ft_sess.c b/fcst/ft_sess.c index 5deafb759..237457bd0 100644 --- a/fcst/ft_sess.c +++ b/fcst/ft_sess.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include "fcst.h" diff --git a/iscsi-scst/include/iscsit_transport.h b/iscsi-scst/include/iscsit_transport.h index 38603fa96..116f724a6 100644 --- a/iscsi-scst/include/iscsit_transport.h +++ b/iscsi-scst/include/iscsit_transport.h @@ -66,4 +66,3 @@ extern void iscsit_unreg_transport(struct iscsit_transport *t); extern struct iscsit_transport *iscsit_get_transport(enum iscsit_transport_type type); #endif /* __ISCSI_TRANSPORT_H__ */ - diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index bb367d10d..1641b600c 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -22,7 +22,6 @@ #include #include #include -#include #ifdef INSIDE_KERNEL_TREE #include #else diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index 1ae05f9da..6516217e2 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -889,7 +889,9 @@ static dev_t devno; static const struct file_operations listener_fops = { .owner = THIS_MODULE, +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) .llseek = no_llseek, +#endif .read = isert_listen_read, .unlocked_ioctl = isert_listen_ioctl, .compat_ioctl = isert_listen_ioctl, @@ -900,7 +902,9 @@ static const struct file_operations listener_fops = { static const struct file_operations conn_fops = { .owner = THIS_MODULE, +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) .llseek = no_llseek, +#endif .read = isert_read, .write = isert_write, .unlocked_ioctl = isert_ioctl, diff --git a/qla2x00t-32gbit/qla2x00-target/qla_tgt.c b/qla2x00t-32gbit/qla2x00-target/qla_tgt.c index 36b289603..b1bd5d8f8 100644 --- a/qla2x00t-32gbit/qla2x00-target/qla_tgt.c +++ b/qla2x00t-32gbit/qla2x00-target/qla_tgt.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c index d30fce685..b7ccd974c 100644 --- a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c +++ b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #ifdef INSIDE_KERNEL_TREE #include diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 733086f75..09f4a6c90 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -28,6 +28,11 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #include #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) +#include +#else +#include +#endif #include #include #include diff --git a/qla2x00t-32gbit/qla_dsd.h b/qla2x00t-32gbit/qla_dsd.h index 20788054b..1a487d8d7 100644 --- a/qla2x00t-32gbit/qla_dsd.h +++ b/qla2x00t-32gbit/qla_dsd.h @@ -1,7 +1,14 @@ #ifndef _QLA_DSD_H_ #define _QLA_DSD_H_ +#ifndef INSIDE_KERNEL_TREE +#include +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) #include +#else +#include +#endif /* 32-bit data segment descriptor (8 bytes) */ struct dsd32 { diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 48c4f86e4..8964148ac 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/qla2x00t-32gbit/qla_target.h b/qla2x00t-32gbit/qla_target.h index 47b80b99a..300501d23 100644 --- a/qla2x00t-32gbit/qla_target.h +++ b/qla2x00t-32gbit/qla_target.h @@ -19,8 +19,6 @@ #ifndef __QLA_TARGET_H #define __QLA_TARGET_H -#include -#include #include "qla_def.h" #include "qla_dsd.h" diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 06ade1a19..93d498744 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -32,7 +32,6 @@ #include #include #include -#include #ifdef INSIDE_KERNEL_TREE #include diff --git a/scst/include/backport.h b/scst/include/backport.h index 7c53e9d3e..6651a39a2 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -49,7 +49,11 @@ #include /* scsi_build_sense_buffer() */ struct scsi_target; #include /* struct bsg_job */ -#include /* get_unaligned_be64() */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) +#include +#else +#include +#endif /* */ diff --git a/scst/include/scst.h b/scst/include/scst.h index 301d10653..ebf5703bf 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -39,10 +39,14 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) #include #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) +#include +#else +#include +#endif #include #include #include -#include #if 0 /* Let's disable it for now to see if users will complain about it */ #define CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT diff --git a/scst/src/dev_handlers/scst_cdrom.c b/scst/src/dev_handlers/scst_cdrom.c index d35be0677..b3679c43a 100644 --- a/scst/src/dev_handlers/scst_cdrom.c +++ b/scst/src/dev_handlers/scst_cdrom.c @@ -21,7 +21,6 @@ #include #include #include -#include #define LOG_PREFIX "dev_cdrom" diff --git a/scst/src/dev_handlers/scst_disk.c b/scst/src/dev_handlers/scst_disk.c index df2f436b0..d8f932bd3 100644 --- a/scst/src/dev_handlers/scst_disk.c +++ b/scst/src/dev_handlers/scst_disk.c @@ -26,7 +26,6 @@ #include #include #include -#include #define LOG_PREFIX "dev_disk" diff --git a/scst/src/dev_handlers/scst_modisk.c b/scst/src/dev_handlers/scst_modisk.c index ace433646..b096cd98e 100644 --- a/scst/src/dev_handlers/scst_modisk.c +++ b/scst/src/dev_handlers/scst_modisk.c @@ -25,7 +25,6 @@ #include #include #include -#include #define LOG_PREFIX "dev_modisk" diff --git a/scst/src/dev_handlers/scst_tape.c b/scst/src/dev_handlers/scst_tape.c index 845b98e7f..f164390b8 100644 --- a/scst/src/dev_handlers/scst_tape.c +++ b/scst/src/dev_handlers/scst_tape.c @@ -25,7 +25,6 @@ #include #include #include -#include #define LOG_PREFIX "dev_tape" diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 0234743ba..851251193 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index cf6f077e8..c6539b492 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #ifdef INSIDE_KERNEL_TREE @@ -3898,4 +3897,3 @@ void __exit scst_cm_exit(void) TRACE_EXIT(); return; } - diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 551afbaf2..5dcb8b141 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #ifndef INSIDE_KERNEL_TREE #include diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index b9c330a80..aaf109288 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -40,7 +40,6 @@ #include #endif #include -#include #ifdef INSIDE_KERNEL_TREE #include diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index 0b8c72b4f..de5590a06 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -18,7 +18,6 @@ #include #include #include -#include #ifdef INSIDE_KERNEL_TREE #include #include