File mhvtl-kernel-module-fix-queuecommand-arg-change.patch of Package mhvtl
From: Lee Duncan <lduncan@suse.com>
Date: Tue Jan 18 11:33:07 PST 2022
Subject: [PATCH] mhvtl kernel module: fix queuecommand arg change
The kernel now assume scsi_done for the "done" argument to the
queue command, so patch our queuecommand routine.
Will be submitted upstream.
---
diff --git a/kernel/mhvtl.c b/kernel/mhvtl.c
index 6ba5d2c3a0ea..099c781b1f52 100644
--- a/kernel/mhvtl.c
+++ b/kernel/mhvtl.c
@@ -275,8 +275,12 @@ static int mhvtl_change_queue_depth(struct scsi_device *sdev, int qdepth,
int reason);
#endif
#endif
-static int mhvtl_queuecommand_lck(struct scsi_cmnd *,
- void (*done) (struct scsi_cmnd *));
+static int mhvtl_queuecommand_lck(struct scsi_cmnd *
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,16,0)
+ , done_funct_t done
+#endif
+ );
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
static int mhvtl_b_ioctl(struct scsi_device *, unsigned int, void __user *);
#else
@@ -593,8 +597,15 @@ static int mhvtl_q_cmd(struct scsi_cmnd *scp,
/**********************************************************************
* Main interface from SCSI mid level
**********************************************************************/
-static int mhvtl_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
+static int mhvtl_queuecommand_lck(struct scsi_cmnd *SCpnt
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,16,0)
+ , done_funct_t done
+#endif
+ )
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
+ void (*done)(struct scsi_cmnd *) = scsi_done;
+#endif
unsigned char *cmd = (unsigned char *) SCpnt->cmnd;
int errsts = 0;
struct mhvtl_lu_info *lu = NULL;