From b973e9fafe0ecbff60985408bb66489b3ab4ad4d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 3 May 2018 13:26:40 +0000 Subject: [PATCH 1/3] scst: Port to RHEL 7.5 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7399 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_dlm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 236db367b..0eaa5ad60 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -519,7 +519,13 @@ out: return ret; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(7, 5)) +#define HAVE_ITERATE_DIR +#endif + +#ifdef HAVE_ITERATE_DIR struct scst_dlm_readdir_context { struct dir_context ctx; char *entries; @@ -537,7 +543,7 @@ static int scst_dlm_filldir(struct dir_context *arg, const char *name_arg, #endif { char *p, *q, name[64]; -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) +#ifndef HAVE_ITERATE_DIR char **entries = arg; #else #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) @@ -593,7 +599,7 @@ static int scst_dlm_update_nodeids(struct scst_pr_dlm_data *pr_dlm) ret = PTR_ERR(comms); goto out; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) +#ifndef HAVE_ITERATE_DIR ret = vfs_readdir(comms, scst_dlm_filldir, &entries); #else { From 753b670a39d6dc3bca83678dceb9c4844f1a81f5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 5 May 2018 08:41:51 +0000 Subject: [PATCH 2/3] scst: Unbreak the build on Debian systems git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7400 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_dlm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 0eaa5ad60..3e001d045 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -30,6 +30,10 @@ #include "scst_pres.h" #include "scst_dlm.h" +#ifndef RHEL_RELEASE_VERSION +#define RHEL_RELEASE_VERSION(maj, min) 0 +#endif + #if (defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE)) && \ !defined(CONFIG_SCST_NO_DLM) From 91f9113cd9e499a11935d017950ecbc5d7e2e1ae Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 5 May 2018 08:42:44 +0000 Subject: [PATCH 3/3] Makefile: Add a missing -q option to a grep command git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7401 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2b60fd1d5..0652efe09 100644 --- a/Makefile +++ b/Makefile @@ -509,7 +509,7 @@ dpkg: ../scst_$(VERSION).orig.tar.xz ) && \ rm -f "$${output_files[@]}" && \ buildopts=(-uc -us) && \ - if dpkg-buildpackage --help 2>&1 | grep -- '-ui'; then \ + if dpkg-buildpackage --help 2>&1 | grep -q -- '-ui'; then \ buildopts+=(-ui); \ fi && \ if dpkg-buildpackage --help 2>&1 | \