From acc573a2bb1dde4a3d53d4366d2e6a28a8c0bfd1 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 2 May 2017 14:10:22 +0000 Subject: [PATCH 1/3] scripts: Update kernel download location git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7161 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/kernel-functions | 16 ++++++---------- scripts/run-regression-tests | 11 ----------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 609ce564e..af499d0a0 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -2,8 +2,7 @@ # Shell functions for parsing the Linux kernel version and for downloading # from kernel.org. -kernel_mirror="http://ftp.kernel.org/pub/linux/kernel" -kernel_longterm="http://www.kernel.org/pub/linux/kernel" +kernel_mirror="http://cdn.kernel.org/pub/linux/kernel" kernel_sources="$HOME/software/downloads" # Kernel version number. @@ -53,16 +52,13 @@ function download_kernel { ( cd "${kernel_sources}" || return $? if [ "$plevel" = "" -o "$plevel" = "0" ] || - download_file "${kernel_mirror}/v$series/patch-$1.xz" || - download_file "${kernel_mirror}/v$series/longterm/v${kver}/patch-$1.xz" + download_file "${kernel_mirror}/v$series/patch-$1.xz" then - download_file "${kernel_mirror}/v$series/linux-${kver}.tar.xz" \ - || download_file "${kernel_mirror}/v$series/longterm/v${kver}/linux-${kver}.tar.xz" \ - || return $? + download_file "${kernel_mirror}/v$series/linux-${kver}.tar.xz" || + return $? else - download_file "${kernel_mirror}/v$series/linux-$1.tar.xz" \ - || download_file "${kernel_mirror}/v$series/longterm/v${kver}/linux-$1.tar.xz" \ - || return $? + download_file "${kernel_mirror}/v$series/linux-$1.tar.xz" || + return $? fi ) } diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index 5fbd9b2bf..4deabe196 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -508,9 +508,6 @@ if [ "${scriptsdir:0:1}" != "/" ]; then fi # Where to store persistenly downloaded kernel tarballs and kernel patches. kernel_sources="$HOME/software/downloads" -# URL for downloading kernel tarballs and kernel patches. -kernel_mirror="http://ftp.kernel.org/pub/linux/kernel" -kernel_longterm="http://www.kernel.org/pub/linux/kernel" kernel_versions="" # Directory in which the regression test output files will be stored. Must be # an absolute path. @@ -542,14 +539,6 @@ done kernel_versions="$*" -# RHEL 4.x / CentOS 4.x has a kernel based on version 2.6.9. -# RHEL 5.x / CentOS 5.x has a kernel based on version 2.6.18. -# Ubuntu 8.04 (Hardy Heron) has a kernel based on version 2.6.24. -# Ubuntu 8.10 (Intrepid Ibex) has a kernel based on version 2.6.27. -# openSUSE 11.0 has a kernel based on version 2.6.25. -# openSUSE 11.1 has a kernel based on version 2.6.27. -#kernel_versions="2.6.23.17 2.6.24.7 2.6.25.20 2.6.26.8 2.6.27.21 2.6.28.9 2.6.29.1" - if [ "${kernel_versions}" = "" ]; then usage exit 1 From 57b16a2fd8ec426fa34c16047099f5e2b1156ff0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 2 May 2017 14:13:15 +0000 Subject: [PATCH 2/3] scst_lib: Fix kernel 2.6.30 build git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7162 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 3da17c97f..3bf505191 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8277,15 +8277,18 @@ static void scsi_end_async(struct request *req, int error) #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) resid_len = scsi_req(req)->resid_len; -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) resid_len = req->resid_len; +#else + /* + * A quote from commit c3a4d78c580d: "rq->data_len served two + * purposes - the length of data buffer on issue and the + * residual count on completion." + */ + resid_len = req->data_len; #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) sioc->done(sioc->data, sioc->sense, result, resid_len); -#else - sioc->done(sioc->data, sioc->sense, result, req->data_len); -#endif } kmem_cache_free(scsi_io_context_cache, sioc); From edebe24bab45c7f3258153981498aeb4f23ab219 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 2 May 2017 14:23:00 +0000 Subject: [PATCH 3/3] scst: Fix build for kernels before v2.6.39 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7163 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index e9917db77..21542ef27 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -356,6 +356,14 @@ static inline int __must_check kref_get_unless_zero(struct kref *kref) } #endif +/* */ + +/* See also commit 207205a2ba26 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) +#define kthread_create_on_node(threadfn, data, node, namefmt, arg...)\ + kthread_create((threadfn), (data), ##arg) +#endif + /* */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) && \