From 5a87137b64bd598682c0340ec937f55cbc38f5b4 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 4 Nov 2018 03:31:34 +0000 Subject: [PATCH] Merge r7399 from trunk git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7656 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 e4fa54a9f..9eef26c17 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 {