@@ -33,6 +33,9 @@ OBJS = $(subst .c,.o,$(CFILES))
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
@@ -13,10 +13,13 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
-LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal
LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a
@@ -41,7 +41,11 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt
+else
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+endif
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
dist-subdircreate:
@@ -15,6 +15,9 @@ ifneq ($(BUILD_CMAP_SUPPORT),)
DEFINES += -DHAVE_CMAP
endif
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+DEFINES += -DHAVE_FSDLM
+endif
ifneq ($(OCFS2_DEBUG_EXE),)
DEBUG_EXE_FILES = $(shell awk '/DEBUG_EXE/{if (k[FILENAME] == 0) {print FILENAME; k[FILENAME] = 1;}}' $(CFILES))
@@ -40,6 +40,9 @@
#ifdef HAVE_CMAP
#include <corosync/cmap.h>
#endif
+#ifdef HAVE_FSDLM
+#include <libdlm.h>
+#endif
#include "o2cb/o2cb.h"
#include "o2cb/o2cb_client_proto.h"
@@ -50,6 +53,7 @@
#define LOCKING_PROTOCOL_FILE "/sys/fs/ocfs2/max_locking_protocol"
#define OCFS2_STACK_LABEL_LEN 4
#define CONTROL_DEVICE "/dev/misc/ocfs2_control"
+#define DLM_RECOVER_CALLBACK "/sys/fs/ocfs2/dlm_recover_callback_support"
static errcode_t o2cb_validate_cluster_name(struct o2cb_cluster_desc *desc);
static errcode_t o2cb_validate_cluster_flags(struct o2cb_cluster_desc *desc,
@@ -1384,6 +1388,26 @@ static errcode_t user_begin_group_join(struct o2cb_cluster_desc *cluster,
char *argv[OCFS2_CONTROLD_MAXARGS + 1];
char buf[OCFS2_CONTROLD_MAXLINE];
+#ifdef HAVE_FSDLM
+ uint32_t maj, min, pat;
+
+ if (strncmp(cluster->c_stack, OCFS2_PCMK_CLUSTER_STACK, OCFS2_STACK_LABEL_LEN))
+ goto no_pcmk;
+
+ rc = dlm_kernel_version(&maj, &min, &pat);
+
+ if (rc < 0)
+ return O2CB_ET_SERVICE_UNAVAILABLE;
+
+ if (read_single_line_file(DLM_RECOVER_CALLBACK, buf, 3) > 0) {
+ /* Controld is not required */
+ if (maj < 6)
+ return O2CB_ET_INTERNAL_FAILURE;
+ return 0;
+ }
+no_pcmk:
+#endif
+
if (control_daemon_fd != -1) {
/* fprintf(stderr, "Join already in progress!\n"); */
err = O2CB_ET_INTERNAL_FAILURE;
@@ -1475,6 +1499,13 @@ static errcode_t user_complete_group_join(struct o2cb_cluster_desc *cluster,
char *argv[OCFS2_CONTROLD_MAXARGS + 1];
char buf[OCFS2_CONTROLD_MAXLINE];
+#ifdef HAVE_FSDLM
+ if (read_single_line_file(DLM_RECOVER_CALLBACK, buf, 3) > 0) {
+ /* Controld is not required */
+ return 0;
+ }
+#endif
+
if (control_daemon_fd == -1) {
/* fprintf(stderr, "Join not started!\n"); */
err = O2CB_ET_SERVICE_UNAVAILABLE;
@@ -1545,6 +1576,13 @@ static errcode_t user_group_leave(struct o2cb_cluster_desc *cluster,
char *argv[OCFS2_CONTROLD_MAXARGS + 1];
char buf[OCFS2_CONTROLD_MAXLINE];
+#ifdef HAVE_FSDLM
+ if (read_single_line_file(DLM_RECOVER_CALLBACK, buf, 3) > 0) {
+ /* Controld is not required */
+ return 0;
+ }
+#endif
+
if (control_daemon_fd != -1) {
/* fprintf(stderr, "Join in progress!\n"); */
err = O2CB_ET_INTERNAL_FAILURE;
@@ -9,7 +9,11 @@ LIBRARIES = libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt
+else
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+endif
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
CFLAGS += -fPIC
@@ -10,7 +10,11 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt
+else
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+endif
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
UNINST_PROGRAMS = listuuid
@@ -13,6 +13,9 @@ LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
@@ -11,10 +11,13 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
-LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
DEFINES = -DVERSION=\"$(VERSION)\"
@@ -9,10 +9,13 @@ LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
-LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal
LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a
@@ -13,11 +13,14 @@ LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
-LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
@@ -13,7 +13,11 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt
+else
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+endif
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
sbindir = $(root_sbindir)
@@ -18,7 +18,7 @@ PCMK_INCLUDES = -I/usr/include/pacemaker -I/usr/include/heartbeat/ $(GLIB_CFLAGS
endif
INCLUDES = -I$(TOPDIR)/include -I. $(PCMK_INCLUDES)
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
@@ -11,10 +11,13 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
-LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
ifndef OCFS2_DYNAMIC_CTL
LDFLAGS += -static
@@ -9,7 +9,11 @@ LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt
+else
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+endif
sbindir = $(root_sbindir)
SBIN_PROGRAMS = ocfs2cdsl
@@ -14,7 +14,11 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt
+else
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+endif
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
ifdef HAVE_BLKID
@@ -12,10 +12,13 @@ LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+ifneq ($(BUILD_FSDLM_SUPPORT),)
+LIBO2CB_LIBS += -ldlm_lt
+endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
-LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
UNINST_LIBRARIES = libocfs2ne.a