From 032f4fd73305260c179a222d571d4a35a580f0f5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 18 Nov 2015 22:44:29 +0000 Subject: [PATCH] scst: Do not build cluster PR support if CONFIG_SCST_NO_DLM has been set git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6700 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/Makefile | 3 ++- scst/src/scst_dlm.c | 3 ++- scst/src/scst_pres.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scst/src/Makefile b/scst/src/Makefile index ee1501fd0..7e1209cc9 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -155,7 +155,8 @@ INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \ - -Wno-unused-parameter -Wno-missing-field-initializers) + -Wno-unused-parameter -Wno-missing-field-initializers) \ + $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) #EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 8e9bdc4f5..342941d96 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -30,7 +30,8 @@ #include "scst_pres.h" #include "scst_dlm.h" -#if defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE) +#if (defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE)) && \ + !defined(CONFIG_SCST_NO_DLM) static void scst_pr_dlm_cleanup(struct scst_device *dev); static void scst_dlm_pre_bast(void *bastarg, int mode); diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 63e9b3f7a..dff5620e1 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -1173,10 +1173,12 @@ void scst_pr_cleanup(struct scst_device *dev) int scst_pr_set_cluster_mode(struct scst_device *dev, bool cluster_mode, const char *cl_dev_id) { - bool cluster_mode_enabled = false; int res = 0; -#if defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE) +#if defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE) && \ + !defined(CONFIG_SCST_NO_DLM) + bool cluster_mode_enabled = false; + cluster_mode_enabled = dev->cl_ops == &scst_dlm_cl_ops; if (cluster_mode_enabled == cluster_mode)