From: Gleb C. <lna...@ya...> - 2024-07-15 12:18:46
|
Commit: faa8f46 GitHub URL: https://github.com/SCST-project/scst/commit/faa8f460d7b7b5206d2c34e5d901a378d73f689f Author: Gleb Chesnokov Date: 2024-07-15T15:18:16+03:00 Log Message: ----------- scst_local, qla2x00t-32gbit: Improve Linux kernel 6.10 porting Fix compilation warnings, errors. Modified Paths: -------------- qla2x00t-32gbit/include/trace/events/qla.h | 15 +++++++++++++++ scst_local/scst_local.c | 9 +++++---- 2 files changed, 20 insertions(+), 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/include/trace/events/qla.h b/qla2x00t-32gbit/include/trace/events/qla.h index e3b4700..8708519 100644 --- a/qla2x00t-32gbit/include/trace/events/qla.h +++ b/qla2x00t-32gbit/include/trace/events/qla.h @@ -2,6 +2,9 @@ #if !defined(_TRACE_QLA_H_) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_QLA_H_ +#ifndef INSIDE_KERNEL_TREE +#include <linux/version.h> +#endif #include <linux/tracepoint.h> #undef TRACE_SYSTEM @@ -22,11 +25,23 @@ DECLARE_EVENT_CLASS(qla_log_event, TP_STRUCT__entry( __string(buf, buf) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) __dynamic_array(char, msg, QLA_MSG_MAX) +#else + __vstring(msg, vaf->fmt, vaf->va) +#endif ), TP_fast_assign( +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) __assign_str(buf, buf); +#else + __assign_str(buf); +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) vsnprintf(__get_str(msg), QLA_MSG_MAX, vaf->fmt, *vaf->va); +#else + __assign_vstr(msg, vaf->fmt, vaf->va); +#endif ), TP_printk("%s %s", __get_str(buf), __get_str(msg)) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 6cd11f7..0e0efed 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1033,6 +1033,7 @@ out: #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) static int scst_local_slave_alloc(struct scsi_device *sdev) { struct request_queue *q = sdev->request_queue; @@ -1048,17 +1049,16 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) #endif #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) /* * vdisk_blockio requires that data buffers have block_size alignment * and supports block sizes from 512 up to 4096. See also * https://github.com/sahlberg/libiscsi/issues/302. */ blk_queue_dma_alignment(q, (4096 - 1)); -#endif return 0; } +#endif static int scst_local_slave_configure(struct scsi_device *sdev) { @@ -1381,10 +1381,11 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) + .slave_alloc = scst_local_slave_alloc, +#else .dma_alignment = (4096 - 1), #endif - .slave_alloc = scst_local_slave_alloc, .slave_configure = scst_local_slave_configure, .eh_abort_handler = scst_local_abort, .eh_device_reset_handler = scst_local_device_reset, |