SHA256
1
0
forked from pool/vhba-kmp

Accepting request 1083227 from filesystems

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1083227
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/vhba-kmp?expand=0&rev=22
This commit is contained in:
Dominique Leuenberger 2023-04-27 18:01:42 +00:00 committed by Git OBS Bridge
commit 18833c1d1d
3 changed files with 68 additions and 1 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Apr 20 08:55:45 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Add vhba-sle-kernel.diff [boo#1206169]
-------------------------------------------------------------------
Mon Dec 5 12:47:43 UTC 2022 - Ludwig Nussel <lnussel@suse.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package vhba-kmp
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -29,6 +29,7 @@ Source: https://downloads.sf.net/cdemu/vhba-module-%version.tar.xz
Source2: %name-preamble
Patch1: vhba-no-werror.diff
Patch2: vhba-devname.diff
Patch3: vhba-sle-kernel.diff
BuildRequires: %kernel_module_package_buildreqs
BuildRequires: kernel-syms >= 2.6.20
@ -57,6 +58,9 @@ echo %flavors_to_build
%autosetup -n vhba-module-%version -p1
%build
%if 0%{?sle_version} >= 150500 && 0%{?sle_version} < 160000
export KCFLAGS="-DSLE"
%endif
for flavor in %flavors_to_build; do
cp -a . "../obj-$flavor/"
pushd "../obj-$flavor/"

58
vhba-sle-kernel.diff Normal file
View File

@ -0,0 +1,58 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2023-04-20 10:58:03.045935811 +0200
Workaround failing VHBA compilation for the SLE 15.5 kernel API.
---
vhba.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: vhba-module-20211218/vhba.c
===================================================================
--- vhba-module-20211218.orig/vhba.c
+++ vhba-module-20211218/vhba.c
@@ -203,7 +203,7 @@ int vhba_device_queue (struct vhba_devic
vcmd->cmd = cmd;
spin_lock_irqsave(&vdev->cmd_lock, flags);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) || defined(SLE)
vcmd->metatag = scsi_cmd_to_rq(vcmd->cmd)->tag;
#else
vcmd->metatag = vcmd->cmd->request->tag;
@@ -477,7 +477,7 @@ int vhba_queuecommand (struct Scsi_Host
int retval;
unsigned int devnum;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) || defined(SLE)
scmd_dbg(cmd, "queue %p tag %i\n", cmd, scsi_cmd_to_rq(cmd)->tag);
#else
scmd_dbg(cmd, "queue %p tag %i\n", cmd, cmd->request->tag);
@@ -489,7 +489,7 @@ int vhba_queuecommand (struct Scsi_Host
scmd_dbg(cmd, "no such device\n");
cmd->result = DID_NO_CONNECT << 16;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) || defined(SLE)
scsi_done(cmd);
#else
cmd->scsi_done(cmd);
@@ -828,7 +828,7 @@ ssize_t vhba_ctl_write (struct file *fil
spin_lock_irqsave(&vdev->cmd_lock, flags);
if (ret >= 0) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) || defined(SLE)
scsi_done(vcmd->cmd);
#else
vcmd->cmd->scsi_done(vcmd->cmd);
@@ -958,7 +958,7 @@ int vhba_ctl_release (struct inode *inod
scmd_dbg(vcmd->cmd, "device released with command %lu (%p)\n", vcmd->metatag, vcmd->cmd);
vcmd->cmd->result = DID_NO_CONNECT << 16;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) || defined(SLE)
scsi_done(vcmd->cmd);
#else
vcmd->cmd->scsi_done(vcmd->cmd);