From 3a6fb66c838841e5157a22e9df94b1b4c1791b3e Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Fri, 21 Aug 2026 10:20:39 +0300 Subject: [PATCH] scst: Remove residual procfs code Procfs support was removed in 2019, but dead configuration guards, patch specialization logic and unused declarations remained. Remove these remnants and simplify paths that can no longer receive procfs-only objects. --- iscsi-scst/include/iscsi_scst_ver.h | 6 +----- iscsi-scst/kernel/conn.c | 2 +- iscsi-scst/kernel/iscsi.c | 6 +----- iscsi-scst/kernel/iscsi.h | 4 ---- qla2x00t/qla2x00-target/qla2x00t.h | 1 - qla2x00t/qla_attr.c | 3 --- scripts/generate-kernel-patch | 2 -- scripts/specialize-patch | 17 ----------------- scst/src/scst_lib.c | 9 ++++----- scst/src/scst_mem.c | 2 +- srpt/src/ib_srpt.c | 2 -- 11 files changed, 8 insertions(+), 46 deletions(-) diff --git a/iscsi-scst/include/iscsi_scst_ver.h b/iscsi-scst/include/iscsi_scst_ver.h index 0d6bfc389..f391c01dc 100644 --- a/iscsi-scst/include/iscsi_scst_ver.h +++ b/iscsi-scst/include/iscsi_scst_ver.h @@ -13,8 +13,4 @@ * GNU General Public License for more details. */ -/* #define CONFIG_SCST_PROC */ - -#define ISCSI_VERSION_STRING_SUFFIX - -#define ISCSI_VERSION_STRING "3.11.0-pre" ISCSI_VERSION_STRING_SUFFIX +#define ISCSI_VERSION_STRING "3.11.0-pre" diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index 8c087b07d..f29a80b66 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -29,7 +29,7 @@ #undef DEFAULT_SYMBOL_NAMESPACE #define DEFAULT_SYMBOL_NAMESPACE SCST_NAMESPACE -#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_SCST_PROC) +#ifdef CONFIG_LOCKDEP static struct lock_class_key scst_conn_key; static struct lockdep_map scst_conn_dep_map = STATIC_LOCKDEP_MAP_INIT("iscsi_conn_kref", &scst_conn_key); diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 6b09c15ad..a38dd52ce 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -3917,8 +3917,7 @@ static int iscsi_target_release(struct scst_tgt *scst_tgt) return 0; } -#if !defined(CONFIG_SCST_PROC) && \ - (defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)) +#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) static struct scst_trace_log iscsi_local_trace_tbl[] = { { TRACE_D_WRITE, "d_write" }, { TRACE_CONN_OC, "conn" }, @@ -3958,11 +3957,8 @@ struct scst_tgt_template iscsi_template = { #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) .default_trace_flags = ISCSI_DEFAULT_LOG_FLAGS, .trace_flags = &trace_flag, -#if !defined(CONFIG_SCST_PROC) && \ - (defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)) .trace_tbl = iscsi_local_trace_tbl, .trace_tbl_help = ISCSI_TRACE_TBL_HELP, -#endif #endif .release = iscsi_target_release, .xmit_response = iscsi_xmit_response, diff --git a/iscsi-scst/kernel/iscsi.h b/iscsi-scst/kernel/iscsi.h index e0eac0758..bf4560b84 100644 --- a/iscsi-scst/kernel/iscsi.h +++ b/iscsi-scst/kernel/iscsi.h @@ -330,9 +330,6 @@ struct iscsi_pdu { unsigned int datasize; }; -typedef void (iscsi_show_info_t)(struct seq_file *seq, - struct iscsi_target *target); - /** Commands' states **/ /* New command and SCST processes it */ @@ -602,7 +599,6 @@ void __iscsi_del_attr(struct iscsi_target *target, struct iscsi_attr *tgt_attr); /* session.c */ extern const struct attribute *iscsi_sess_attrs[]; extern const struct attribute *iscsi_acg_attrs[]; -extern const struct file_operations session_seq_fops; struct iscsi_session *session_lookup(struct iscsi_target *target, u64 sid); void sess_reinst_finished(struct iscsi_session *session); diff --git a/qla2x00t/qla2x00-target/qla2x00t.h b/qla2x00t/qla2x00-target/qla2x00t.h index 3a91973ee..2ed17d663 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.h +++ b/qla2x00t/qla2x00-target/qla2x00t.h @@ -36,7 +36,6 @@ #define Q2T_VERSION(a, b, c, d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d)) #define Q2T_VERSION_CODE Q2T_VERSION(3, 11, 0, 0) #define Q2T_VERSION_STRING "3.11.0-pre" -#define Q2T_PROC_VERSION_NAME "version" #define Q2T_MAX_CDB_LEN 16 #define Q2T_TIMEOUT 10 /* in seconds */ diff --git a/qla2x00t/qla_attr.c b/qla2x00t/qla_attr.c index 0b798d455..2faf866b2 100644 --- a/qla2x00t/qla_attr.c +++ b/qla2x00t/qla_attr.c @@ -102,9 +102,6 @@ static DEVICE_ATTR(class2_enabled, #ifdef CONFIG_SCSI_QLA2XXX_TARGET -/* #define CONFIG_SCST_PROC */ - - static ssize_t qla2x00_show_ini_mode_force_reverse(struct device *dev, struct device_attribute *attr, char *buffer) diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index 59458daca..c818a57a4 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -255,8 +255,6 @@ else scst_makefile="Makefile.scst" fi -specialize_patch_options+=(-v "config_scst_proc_undefined=1") - if [ "${debug_specialize}" = "true" ]; then specialize_patch_options+=(-v "debug=1") fi diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 06e49bafc..a7151168c 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -273,10 +273,6 @@ function evaluate(stmnt, pattern, arg, op, result) { gsub("defined[[:blank:]]*\\([[:blank:]]*CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION[[:blank:]]*\\)", 0, stmnt) } - gsub("defined[[:blank:]]+CONFIG_SCST_PROC", !config_scst_proc_undefined, stmnt) - gsub("defined[[:blank:]]*\\([[:blank:]]*CONFIG_SCST_PROC[[:blank:]]*\\)", !config_scst_proc_undefined, - stmnt) - if (debug) printf "/* debug specialize-patch: (b) %s */\n", stmnt @@ -424,7 +420,6 @@ function handle_if(evaluated) # Only act on preprocessor conditional expressions with regard to the Linux # kernel version, and do not interpret other expressions. if ($0 ~ "LINUX_VERSION_CODE" \ - || $0 ~ "CONFIG_SCST_PROC" \ || $0 ~ "CONFIG_SCST_STRICT_SERIALIZING" \ || $0 ~ "CREATE_SEND_MAD_HAS_AH_ARG" \ || $0 ~ "CREATE_SEND_MAD_HAS_BASE_ARG" \ @@ -466,7 +461,6 @@ function handle_if(evaluated) || generating_upstream_patch_defined \ && $0 ~ "GENERATING_UPSTREAM_PATCH" \ || $0 ~ "CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION" \ - || ($0 ~ "CONFIG_SCST_PROC" && config_scst_proc_undefined) \ || ($0 ~ "SCST_IO_CONTEXT" && SCST_IO_CONTEXT != "")) { } @@ -673,9 +667,6 @@ BEGIN { generating_upstream_patch_defined = 0 if (config_tcp_zero_copy_transfer_completion_notification_undefined != 0 && config_tcp_zero_copy_transfer_completion_notification_undefined != 1) config_tcp_zero_copy_transfer_completion_notification_undefined = 0 - if (config_scst_proc_undefined != 0 && config_scst_proc_undefined != 1) - config_scst_proc_undefined = 0 - # Variable initialization. process_file = 0 reset_hunk_state_variables() @@ -700,14 +691,6 @@ BEGIN { next } - if (!config_scst_proc_undefined) - { - gsub("^+/\\* #define CONFIG_SCST_PROC \\*/$", "+#define CONFIG_SCST_PROC") - } - else - { - gsub("^+/\\* #define CONFIG_SCST_PROC \\*/$", "+") - } input_line[0] = $0 input_line_count = 1 # Join continued lines before processing these. diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 07e30cff5..95f590461 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -4636,7 +4636,7 @@ int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent, PRINT_INFO("Added device %s to group %s (LUN %lld, " "flags 0x%x) to target %s", dev->virt_name, acg->acg_name, - lun, flags, acg->tgt ? acg->tgt->tgt_name : "?"); + lun, flags, acg->tgt->tgt_name); if (out_acg_dev != NULL) *out_acg_dev = acg_dev; @@ -4709,7 +4709,7 @@ static struct scst_acg_dev *__scst_acg_del_lun(struct scst_acg *acg, scst_del_acg_dev(acg_dev, true, true); PRINT_INFO("Removed LUN %lld from group %s (target %s)", - lun, acg->acg_name, acg->tgt ? acg->tgt->tgt_name : "?"); + lun, acg->acg_name, acg->tgt->tgt_name); out: return acg_dev; @@ -5035,8 +5035,7 @@ static void scst_free_acg(struct scst_acg *acg) lockdep_assert_held(&scst_mutex); - /* For procfs acg->tgt could be NULL */ - TRACE_DBG("Freeing acg %s/%s", tgt ? tgt->tgt_name : "(tgt=NULL)", acg->acg_name); + TRACE_DBG("Freeing acg %s/%s", tgt->tgt_name, acg->acg_name); list_for_each_entry_safe(acg_dev, acg_dev_tmp, &acg->acg_dev_list, acg_dev_list_entry) { list_for_each_entry_safe(tgt_dev, tt, &acg_dev->dev->dev_tgt_dev_list, @@ -5906,7 +5905,7 @@ int scst_acg_add_acn(struct scst_acg *acg, const char *name) out: if (res == 0) { PRINT_INFO("Added name %s to group %s (target %s)", name, - acg->acg_name, acg->tgt ? acg->tgt->tgt_name : "?"); + acg->acg_name, acg->tgt->tgt_name); scst_check_reassign_sessions(); } diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index 5586a7da9..94adc47a0 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -55,7 +55,7 @@ static struct sgv_pool *sgv_norm_pool_global[NR_CPUS]; static struct sgv_pool *sgv_norm_clust_pool_main, *sgv_norm_pool_main, *sgv_dma_pool_main; -#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_SCST_PROC) +#ifdef CONFIG_LOCKDEP static struct lock_class_key scst_pool_key; static struct lockdep_map scst_pool_dep_map = STATIC_LOCKDEP_MAP_INIT("scst_pool_kref", &scst_pool_key); diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 53651b2fd..46eda28b8 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -65,8 +65,6 @@ /* Flags to be used in SCST debug tracing statements. */ #define DEFAULT_SRPT_TRACE_FLAGS (TRACE_OUT_OF_MEM | TRACE_MINOR \ | TRACE_MGMT | TRACE_SPECIAL) -/* Name of the entry that will be created under /proc/scsi_tgt/ib_srpt. */ -#define SRPT_PROC_TRACE_LEVEL_NAME "trace_level" #endif #define DEFAULT_SRPT_ID_STRING "SCST SRP target"