mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 21:21:28 +00:00
scst_local, qla2x00t-32gbit: Improve Linux kernel 6.10 porting
Fix compilation warnings, errors.
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user