From eea998f6f2f0e779de76b88eb5ebfac11fb44a88 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 22 Nov 2018 21:07:45 +0000 Subject: [PATCH] Merge r7822:7826 from trunk git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7827 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/generate-kernel-patch | 14 +++++++------- scripts/kernel-functions | 2 +- scst/include/backport.h | 5 ++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index bc4c70f2d..8ecdecf1c 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -219,7 +219,7 @@ else fi # Include fcst in the patch for kernel versions 2.6.33 and later. -if [ "${kver}" ">" "2.6.32" ]; then +if kernel_version_le "2.6.33" "${kver}"; then include_fcst="true" else include_fcst="false" @@ -269,8 +269,6 @@ do fi done -download_kernel "${kver}" || exit $? - # General kernel patches. scsi_exec_req_fifo_defined=0 @@ -338,7 +336,7 @@ mkdir -p "${tmpdir}" tmp_Kconfig="${tmpdir}/Kconfig.scst-${kver}" # shellcheck disable=SC2002 cat "scst/kernel/in-tree/Kconfig.scst" | \ -if [ "${include_fcst}" ]; then +if [ "${include_fcst}" = true ]; then cat else grep -v '^source "drivers/scst/fcst/Kconfig"$' @@ -353,7 +351,7 @@ if [ "$include_proc_impl" != "true" ]; then else cat fi | \ - if [ "${include_fcst}" ] && [ "${kver}" != "2.6.37" ] && + if [ "${include_fcst}" = true ] && [ "${kver}" != "2.6.37" ] && [ "${kver}" != "2.6.38" ]; then cat else @@ -426,7 +424,7 @@ done \ # Directory drivers/scst/fcst/ -{ +if [ "${include_fcst}" = true ]; then if [ -e "${fcst_patch_series}" ]; then grep -v '^#' "${fcst_patch_series}" | while read -r f; do @@ -443,7 +441,7 @@ done \ [ -e "$f" ] || continue add_file "${f}" "drivers/scst/fcst/${f#fcst/}" done -} \ +fi \ | process_patch "fcst.diff" add_file "fcst/README" "Documentation/scst/README.fcst" \ @@ -499,6 +497,8 @@ add_file "iscsi-scst/README_in-tree" "Documentation/scst/README.iscsi" \ if [ "${qla2x00t}" = "true" ]; then + download_kernel "${kver3}" || exit $? + ( cd qla2x00t && ./generate-in-tree-patches "$1" ) for f in qla2x00t/in-tree-patches/"$1"/*.patch; do diff --git a/scripts/kernel-functions b/scripts/kernel-functions index b66b368ff..90f0a5d0a 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -7,7 +7,7 @@ kernel_sources="$HOME/software/downloads" # Whether or not kernel version $1 is lower than or equal kernel version $2. function kernel_version_le { - awk -v "v1=$1" -v "v2=$2" 'BEGIN { n1 = split(v1, v1a, "."); n2 = split(v2, v2a, "."); for (i=1;;i++) { e1 = i <= n1 ? v1a[i] : 0; e2 = i <= n2 ? v2a[i] : 0; if (e1 < e2 || i >= n1 && i >= n2) exit 0; if (e1 > e2) exit 1; }}' + awk -v "v1=$1" -v "v2=$2" 'BEGIN { n1 = split(v1, v1a, "."); n2 = split(v2, v2a, "."); for (i=1;;i++) { e1 = i <= n1 ? v1a[i] : 0; e2 = i <= n2 ? v2a[i] : 0; if (e1 < e2 || i > n1 && i > n2) exit 0; if (e1 > e2) exit 1; }}' } # Kernel version number. diff --git a/scst/include/backport.h b/scst/include/backport.h index b0e091486..72532b189 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -25,6 +25,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) #include /* struct bsg_job */ #endif +#include #include /* struct scatterlist */ #include /* kmalloc() */ #include /* sizeof_field() */ @@ -309,9 +310,11 @@ typedef unsigned int __poll_t; #define EPOLLNVAL POLLNVAL #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) && !defined(EPOLLIN) /* * See also commit 7e040726850a ("eventpoll.h: add missing epoll event masks"). + * Note: this commit got backported to multiple stable kernels, including + * v3.18.93. */ #define EPOLLIN POLLIN #define EPOLLPRI POLLPRI