Only in lin_tape-3.0.66-ifdefs: lin_tape.fixlist diff -ur lin_tape-3.0.66/lin_tape_scsi_tape.c lin_tape-3.0.66-ifdefs/lin_tape_scsi_tape.c --- lin_tape-3.0.66/lin_tape_scsi_tape.c 2023-08-08 23:45:15.000000000 +0200 +++ lin_tape-3.0.66-ifdefs/lin_tape_scsi_tape.c 2023-12-25 23:05:43.253011166 +0100 @@ -2028,8 +2028,8 @@ &drv->tape_log_len, TRC_SCSI_IOC); #ifdef KERNELVERSION_5_14_0_70 rc = scsi_ioctl(drv->dev_obj, command, (void*)arg); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) - rc = scsi_ioctl(drv->dev_obj, filp->f_flags, command, (void*)arg); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) + rc = scsi_ioctl(drv->dev_obj, NULL, filp->f_flags, command, (void*)arg); #else rc = scsi_ioctl(drv->dev_obj, command, (void*)arg); #endif @@ -5597,8 +5597,8 @@ log_changer((*chgp), TRC_SMCIOC_CMD, True); #ifdef KERNELVERSION_5_14_0_70 rc = scsi_ioctl((*chgp)->dev_obj, command, (void*)arg); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5,14,1) || defined(SLESSP5)) - rc = scsi_ioctl((*chgp)->dev_obj, filp->f_flags, command, (void*)arg); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) + rc = scsi_ioctl((*chgp)->dev_obj, NULL, filp->f_flags, command, (void*)arg); #else rc = scsi_ioctl((*chgp)->dev_obj, command, (void*)arg); #endif @@ -11556,7 +11556,7 @@ memset(pages, '\0', drv->supported_sg_tablesize * sizeof(struct page*)); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) down_read(¤t->mm->mmap_lock); #else down_read(¤t->mm->mmap_sem); @@ -11577,7 +11577,7 @@ mapped_pages = get_user_pages(current, current->mm, (ulong)user_location, number_pages, rw, 0, pages, NULL); #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) up_read(¤t->mm->mmap_lock); #else up_read(¤t->mm->mmap_sem); diff -ur lin_tape-3.0.66/Makefile lin_tape-3.0.66-ifdefs/Makefile --- lin_tape-3.0.66/Makefile 2023-08-08 23:45:15.000000000 +0200 +++ lin_tape-3.0.66-ifdefs/Makefile 2023-12-25 23:02:51.396800274 +0100 @@ -20,55 +20,10 @@ lin_tape-objs := join.o lin_tape_scsi_config.o lin_tape_scsi_tape.o lin_tape_scsi_trace.o \ lin_tape_ioctl_tape.o lin_tape_ioctl_changer.o lin_tape_extra_ioctl.o -RHELRELEASE := $(shell [ -f "/etc/redhat-release" ] && echo 1 || echo 0) -ifeq ($(RHELRELEASE), 1) -KERNELDIR ?= /lib/modules/$(shell uname -r)/build -KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/") -EXTRA_CFLAGS += -DKERNELVERSION_${KERNELVER} -else -UBUNTURELEASE := $(shell [ -f "/etc/os-release" ] && grep -qi Ubuntu /etc/os-release && echo 1 || echo 0) -ifeq ($(UBUNTURELEASE), 1) -EXTRA_CFLAGS += -DUBUNTUVERSION -else -EXTRA_CFLAGS += -DSLESVERSION -KERNELDIR ?= /lib/modules/$(shell uname -r)/build -KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/") -EXTRA_CFLAGS += -DSLESKERNEL_${KERNELVER} -SLESSP2 := $(shell grep -qi SP2 /etc/*release && echo 1 || echo 0) -SLESSP5 := $(shell grep -qi SP5 /etc/*release && echo 1 || echo 0) -ifeq ($(SLESSP2), 1) -EXTRA_CFLAGS += -DSLESSP2 -endif -ifeq ($(SLESSP5), 1) -EXTRA_CFLAGS += -DSLESSP5 -endif -endif -endif - ifeq ($(SFMP), 1) EXTRA_CFLAGS += -DSFMPENABLED endif -PROC := $(shell uname -m) -ifeq ($(UBUNTURELEASE), 0) -ifeq ($(PROC), ppc64) -EXTRA_CFLAGS += -m64 -endif - -ifeq ($(PROC), powerpc64) -EXTRA_CFLAGS += -m64 -endif - -ifeq ($(PROC), powerpc) -EXTRA_CFLAGS += -m64 -msoft-float -LDFLAGS += -melf64ppc -endif - -ifeq ($(PROC), x86_64) -EXTRA_CFLAGS += -mcmodel=kernel -endif -endif - VERSION := $(word 1,$(VERSIONRELEASE)) RELEASE := $(word 2,$(VERSIONRELEASE)) ifeq ($(RELEASE),) diff -ur lin_tape-3.0.66/pfo.h lin_tape-3.0.66-ifdefs/pfo.h --- lin_tape-3.0.66/pfo.h 2023-08-08 23:45:15.000000000 +0200 +++ lin_tape-3.0.66-ifdefs/pfo.h 2023-12-25 23:02:51.400133506 +0100 @@ -23,149 +23,6 @@ #include "apfo.h" #include -/* The intent of the following defines is that the code - * will build for various releases of Linux. This is how - * we track different versions using ifdef in the source. - */ -#ifdef KERNELVERSION_2_6_32_220 -#define BEFORE_RH_63 1 -#define BEFORE_RH_64 1 -#define BEFORE_RH_65 1 -#define BEFORE_RH_66 1 -#define BEFORE_RH_67 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_71 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_2_6_32_279 -#define AFTER_RH_62 1 -#define BEFORE_RH_64 1 -#define BEFORE_RH_65 1 -#define BEFORE_RH_66 1 -#define BEFORE_RH_67 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_71 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_2_6_32_358 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define BEFORE_RH_65 1 -#define BEFORE_RH_66 1 -#define BEFORE_RH_67 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_2_6_32_431 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define BEFORE_RH_66 1 -#define BEFORE_RH_67 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_71 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_2_6_32_504 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define BEFORE_RH_67 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_71 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_2_6_32_573 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_71 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_2_6_32_642 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define AFTER_RH_67 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_71 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_2_6_32_696 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define AFTER_RH_67 1 -#define AFTER_RH_68 1 -#define BEFORE_RH_70 1 -#define BEFORE_RH_71 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_3_10_0_123 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define AFTER_RH_67 1 -#define AFTER_RH_6x 1 -#define BEFORE_RH_71 1 -#endif -#ifdef KERNELVERSION_3_10_0_229 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define AFTER_RH_67 1 -#define AFTER_RH_6x 1 -#define AFTER_RH_70 1 -#define BEFORE_RH_72 1 -#endif -#ifdef KERNELVERSION_3_10_0_327 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define AFTER_RH_67 1 -#define AFTER_RH_6x 1 -#define AFTER_RH_70 1 -#define AFTER_RH_71 1 -#endif -#ifdef KERNELVERSION_3_10_0_514 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define AFTER_RH_67 1 -#define AFTER_RH_6x 1 -#define AFTER_RH_70 1 -#define AFTER_RH_71 1 -#define AFTER_RH_72 1 -#endif -#ifdef KERNELVERSION_3_10_0_693 -#define AFTER_RH_62 1 -#define AFTER_RH_63 1 -#define AFTER_RH_64 1 -#define AFTER_RH_65 1 -#define AFTER_RH_66 1 -#define AFTER_RH_67 1 -#define AFTER_RH_6x 1 -#define AFTER_RH_70 1 -#define AFTER_RH_71 1 -#define AFTER_RH_72 1 -#define AFTER_RH_73 1 -#endif /* Misc defines needed so source is same for all versions of Linux */ #ifndef SDEV_TRANSPORT_OFFLINE diff -ur lin_tape-3.0.66/upper.c lin_tape-3.0.66-ifdefs/upper.c --- lin_tape-3.0.66/upper.c 2023-08-08 23:45:15.000000000 +0200 +++ lin_tape-3.0.66-ifdefs/upper.c 2023-12-25 23:05:43.253011166 +0100 @@ -255,8 +255,8 @@ DBG_INFO("Sent to kernel cmd=0x%04X\n", ioctl_cmd); #ifdef KERNELVERSION_5_14_0_70 return scsi_ioctl(sdev, ioctl_cmd, arg); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) - return scsi_ioctl(sdev, filp->f_flags, ioctl_cmd, arg); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) + return scsi_ioctl(sdev, NULL, filp->f_flags, ioctl_cmd, arg); #else return scsi_ioctl(sdev, ioctl_cmd, arg); #endif @@ -279,8 +279,8 @@ } else { #ifdef KERNELVERSION_5_14_0_70 return scsi_ioctl(sdev, ioctl_cmd, arg); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) - return scsi_ioctl(sdev, filp->f_flags, ioctl_cmd, arg); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) + return scsi_ioctl(sdev, NULL, filp->f_flags, ioctl_cmd, arg); #else return scsi_ioctl(sdev, ioctl_cmd, arg); #endif @@ -305,9 +305,9 @@ #ifdef KERNELVERSION_5_14_0_70 if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE)) -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) if (!scsi_cmd_allowed(pfo_cmd->scsi_cmd, mode & FMODE_WRITE)) -#elif LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) && (defined(SLESVERSION) || defined(UBUNTUVERSION)) +#elif LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE)) #else /* RHEL 6.4 and beyond */ @@ -564,14 +564,12 @@ /* SG_IO howto says that the shorter of the two wins */ iov_data_len = iov_length((struct iovec *)iov, hdr->iovec_count); -#if !defined (UBUNTUVERSION) if (hdr->dxfer_len < iov_data_len) { hdr->iovec_count = iov_shorten((struct iovec *)iov, hdr->iovec_count, hdr->dxfer_len); iov_data_len = hdr->dxfer_len; } -#endif pfo_cmd.buffer = iov; pfo_cmd.bufflen = iov_data_len; pfo_cmd.iov_count = hdr->iovec_count; @@ -663,9 +661,9 @@ #ifdef KERNELVERSION_5_14_0_70 err = blk_verify_command(scsi_cmd, mode & FMODE_WRITE); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) err = !scsi_cmd_allowed(scsi_cmd, mode & FMODE_WRITE); -#elif LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) && (defined(SLESVERSION) || defined(UBUNTUVERSION)) +#elif LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) err = blk_verify_command(scsi_cmd, mode & FMODE_WRITE); #else /* RHEL 6.4 and beyond */ @@ -785,8 +783,8 @@ DBG_INFO("Sent to kernel cmd=0x%04X\n", ioctl_cmd); #ifdef KERNELVERSION_5_14_0_70 return scsi_cmd_ioctl(q, disk, mode, ioctl_cmd, arg); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) - return scsi_ioctl(sdev, mode, ioctl_cmd, arg); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) + return scsi_ioctl(sdev, disk, mode, ioctl_cmd, arg); #else return scsi_cmd_ioctl(q, disk, mode, ioctl_cmd, arg); #endif @@ -809,8 +807,8 @@ } else { #ifdef KERNELVERSION_5_14_0_70 return scsi_cmd_ioctl(q, disk, mode, ioctl_cmd, arg); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) - return scsi_ioctl(sdev, mode, ioctl_cmd, arg); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) + return scsi_ioctl(sdev, disk, mode, ioctl_cmd, arg); #else return scsi_cmd_ioctl(q, disk, mode, ioctl_cmd, arg); #endif @@ -963,8 +961,8 @@ } else { #ifdef KERNELVERSION_5_14_0_70 return sg_scsi_ioctl(q, disk, mode, sic); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 1) || defined(SLESSP5)) - return scsi_ioctl(sdev, mode, cmd_in, sic); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) + return scsi_ioctl(sdev, disk, mode, cmd_in, sic); #else return sg_scsi_ioctl(q, disk, mode, sic); #endif