summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2015-01-06 15:12:59 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-02-23 04:35:37 -0800
commit30357bcfcd4a7c92e0e59ff58a26d48c8416c564 (patch)
tree4bd795031072a87eaf2ffe0e979c44f16cccf9be
parenta671b9a575b89c263af161293e78e49484859ec7 (diff)
build, glusterd: Add liburcu to build system
This patch adds liburcu related checks to the build system and updates the spec file to require 'userspace-rcu'. liburcu >= 0.7 is required to build GlusterFS, but 0.8 and above is preferred. For cases when liburcu 0.7.x is the available version, some function definitions (currently just one) from liburcu-0.8.6 have been made available in /contrib/userspace-rcu/. This change was developed on the git branch at [1]. This commit is a combination of the following commits on the development branch. a5cd6bd Add userspace-rcu checks to configure.ac fe5ced3 Add URCU libs to glusterd libtool flags 1e43302 Add local definition of cds_list_add_tail_rcu for liburcu-0.7 98da755 Move local definition of cds_list_add_tail_rcu into contrib 8c44dfd Update spec file to include userspace-rcu0466e33 Rename rculist-additional.h to rculist-extra.h 947c7b3 Add rculist-extra.h to dist 19f32ad Address review comments 9605/1 [1]: https://github.com/kshlm/glusterfs/tree/urcu Change-Id: Ifbb617d0dacce8fa01214f894badb9d8cdcaf56f BUG: 1191030 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/9605 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
-rw-r--r--configure.ac7
-rw-r--r--contrib/userspace-rcu/rculist-extra.h42
-rw-r--r--glusterfs.spec.in4
-rw-r--r--xlators/mgmt/glusterd/src/Makefile.am14
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h7
5 files changed, 68 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 7967363ba53..2d93ce847b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1098,6 +1098,13 @@ if test "x$BUILD_GLUPY" = "xyes"; then
fi
# end glupy section
+dnl Check for userspace-rcu
+PKG_CHECK_MODULES([URCU], [liburcu-bp])
+PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.8], [],
+ [PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.7],
+ [AC_DEFINE(URCU_0_7, 1, [Define if liburcu 0.7 is found])],
+ [AC_MSG_ERROR([liburcu >= 0.7 required])])])
+
AC_SUBST(CFLAGS)
# end enable debug section
diff --git a/contrib/userspace-rcu/rculist-extra.h b/contrib/userspace-rcu/rculist-extra.h
new file mode 100644
index 00000000000..274cf9f9d7a
--- /dev/null
+++ b/contrib/userspace-rcu/rculist-extra.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2002 Free Software Foundation, Inc.
+ * (originally part of the GNU C Library)
+ * Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+ *
+ * Copyright (C) 2009 Pierre-Marc Fournier
+ * Conversion to RCU list.
+ * Copyright (C) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef URCU_RCULIST_EXTRA_H
+#define URCU_RCULIST_EXTRA_H
+/* Copying this definition from liburcu-0.8 as liburcu-0.7 does not have this
+ * particular list api
+ */
+/* Add new element at the tail of the list. */
+
+static inline
+void cds_list_add_tail_rcu(struct cds_list_head *newp,
+ struct cds_list_head *head)
+{
+ newp->next = head;
+ newp->prev = head->prev;
+ rcu_assign_pointer(head->prev->next, newp);
+ head->prev = newp;
+}
+
+#endif
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 1b163245f68..70ea5332738 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -197,6 +197,7 @@ BuildRequires: libaio-devel
BuildRequires: python-devel
BuildRequires: python-ctypes
BuildRequires: cmockery2-devel
+BuildRequires: userspace-rcu-devel >= 0.7
%if ( 0%{!?_without_systemtap:1} )
BuildRequires: systemtap-sdt-devel
%endif
@@ -1038,6 +1039,9 @@ fi
%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
%changelog
+* Wed Feb 18 2015 Kaushal M <kaushal@redhat.com>
+- add userspace-rcu as a requirement
+
* Fri Feb 13 2015 Gaurav Kumar Garg <ggarg@redhat.com>
- .cmd_log_history file should be renamed to cmd_history.log post
upgrade (#1165996)
diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am
index 24d2579c64e..fcade87fd3e 100644
--- a/xlators/mgmt/glusterd/src/Makefile.am
+++ b/xlators/mgmt/glusterd/src/Makefile.am
@@ -20,7 +20,7 @@ glusterd_la_SOURCES = glusterd.c glusterd-handler.c glusterd-sm.c \
glusterd_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
$(top_builddir)/rpc/xdr/src/libgfxdr.la \
$(top_builddir)/rpc/rpc-lib/src/libgfrpc.la \
- $(XML_LIBS) -lcrypto
+ $(XML_LIBS) -lcrypto $(URCU_LIBS) $(URCU_CDS_LIBS)
if ENABLE_BD_XLATOR
glusterd_la_LIBADD += -llvm2app
endif
@@ -34,19 +34,21 @@ noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h \
glusterd-conn-mgmt.h glusterd-conn-helper.h glusterd-proc-mgmt.h \
glusterd-svc-mgmt.h glusterd-shd-svc.h glusterd-nfs-svc.h \
glusterd-quotad-svc.h glusterd-svc-helper.h glusterd-snapd-svc.h \
- glusterd-snapd-svc-helper.h
+ glusterd-snapd-svc-helper.h \
+ $(CONTRIBDIR)/userspace-rcu/rculist-extra.h
AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
-I$(rpclibdir) -I$(CONTRIBDIR)/rbtree \
-I$(top_srcdir)/rpc/xdr/src -I$(top_srcdir)/rpc/rpc-lib/src \
-I$(CONTRIBDIR)/uuid -I$(CONTRIBDIR)/mount \
+ -I$(CONTRIBDIR)/userspace-rcu \
-DSBIN_DIR=\"$(sbindir)\" -DDATADIR=\"$(localstatedir)\" \
- -DGSYNCD_PREFIX=\"$(libexecdir)/glusterfs\"\
- -DSYNCDAEMON_COMPILE=$(SYNCDAEMON_COMPILE) $(XML_CPPFLAGS)
+ -DGSYNCD_PREFIX=\"$(libexecdir)/glusterfs\" \
+ -DSYNCDAEMON_COMPILE=$(SYNCDAEMON_COMPILE) $(XML_CPPFLAGS)
-AM_CFLAGS = -Wall $(GF_CFLAGS)
+AM_CFLAGS = -Wall $(GF_CFLAGS) $(URCU_CFLAGS) $(URCU_CDS_CFLAGS)
-AM_LDFLAGS = -L$(xlatordir)
+AM_LDFLAGS = -L$(xlatordir) $(URCU_LIBS) $(URCU_CDS_LIBS)
CLEANFILES =
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 298551c2d9e..941a587d175 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -20,6 +20,12 @@
#include <pthread.h>
#include <libgen.h>
+#include <urcu-bp.h>
+#include <urcu/rculist.h>
+#ifdef URCU_0_7
+#include "rculist-extra.h"
+#endif
+
#include "uuid.h"
#include "rpc-clnt.h"
@@ -1057,4 +1063,5 @@ glusterd_add_brick_status_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo,
int32_t
glusterd_handle_snap_limit (dict_t *dict, dict_t *rsp_dict);
+
#endif