Skip to contentSkip to conversation

LVM2 ./Makefile.in ./configure.in daemons/Make ...

PATCH [email protected] 1 participant 1 message Aug 13, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2009-08-13 16:34:07

Modified files:

	.              : Makefile.in configure.in 
	daemons        : Makefile.in 
	daemons/clogd  : clogd.c cluster.c cluster.h common.h 

functions.c functions.h link_mon.c link_mon.h local.c local.h logging.c logging.h

Log message:
cluster log daemon (clogd): Add to LVM build system

This check-in includes the touch-ups, make file changes, copyrights, and other necessities to include the cluster log daemon into the build system.

[autoconf still needs to be run to generate the 'configure' and 'Makefile' files.]

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.105&r2=1.106
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/Makefile.in.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/clogd.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/cluster.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/cluster.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/common.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/functions.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/functions.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/link_mon.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/link_mon.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/local.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/local.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/logging.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/logging.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4

Makefile.in +1 -0
@@ -34,6 +34,7 @@
 
 ifeq ($(MAKECMDGOALS),distclean)
   SUBDIRS += daemons/clvmd \
+	     daemons/clogd \
 	     daemons/dmeventd/plugins \
 	     daemons/dmeventd \
 	     lib/format1 \
configure.in +21 -2
@@ -63,7 +63,7 @@
 
 ################################################################################
 dnl -- Checks for programs.
-AC_PROG_SED
+m4_pattern_allow(AC_PROG_SED)
 AC_PROG_AWK
 AC_PROG_CC
 
@@ -72,7 +72,7 @@
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
-AC_PROG_MKDIR_P
+m4_pattern_allow(AC_PROG_MKDIR_P)
 AC_PROG_RANLIB
 AC_PATH_PROG(CFLOW_CMD, cflow)
 AC_PATH_PROG(CSCOPE_CMD, cscope)
@@ -353,6 +353,23 @@
 fi
 
 ################################################################################
+dnl -- Build cluster log daemon
+AC_MSG_CHECKING(whether to build cluster log daemon)
+AC_ARG_ENABLE(clogd, [  --enable-clogd          Enable the cluster log daemon],
+CLOGD=$enableval)
+AC_MSG_RESULT($CLOGD)
+
+dnl -- Look for corosync libraries if required.
+if [[ "x$CLOGD" = xall -o `expr x"$CLOGD" : '.*corosync.*'` != 0 ]]; then
+#
+#       FIXME: ALSO NEED TO CHECK FOR CHECKPOINT MODULE
+#
+	PKG_CHECK_MODULES(CPG, libcpg, [],
+		[AC_MSG_RESULT([no pkg for libcpg library, using -lcpg]);
+		CPG_LIBS="-lcpg"])
+fi
+
+################################################################################
 dnl -- Enable debugging
 AC_MSG_CHECKING(whether to enable debugging)
 AC_ARG_ENABLE(debug,    [  --enable-debug          Enable debugging],
@@ -801,6 +818,7 @@
 AC_SUBST(CLDWHOLEARCHIVE)
 AC_SUBST(CLUSTER)
 AC_SUBST(CLVMD)
+AC_SUBST(CLOGD)
 AC_SUBST(CMDLIB)
 AC_SUBST(CONFDB_CFLAGS)
 AC_SUBST(CONFDB_LIBS)
@@ -870,6 +888,7 @@
 make.tmpl
 daemons/Makefile
 daemons/clvmd/Makefile
+daemons/clogd/Makefile
 daemons/dmeventd/Makefile
 daemons/dmeventd/libdevmapper-event.pc
 daemons/dmeventd/plugins/Makefile
daemons/Makefile.in +4 -0
@@ -21,6 +21,10 @@
   SUBDIRS = clvmd
 endif
 
+ifeq ("@CLOGD@", "yes")
+  SUBDIRS += clogd
+endif
+
 ifeq ("@DMEVENTD@", "yes")
   SUBDIRS += dmeventd
 endif
daemons/clogd/clogd.c +12 -1
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -13,9 +24,9 @@
 #include <linux/types.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
-#include <linux/dm-log-userspace.h>
 #include <linux/dm-ioctl.h>
 
+#include "dm-log-userspace.h"
 #include "functions.h"
 #include "local.h"
 #include "cluster.h"
daemons/clogd/cluster.c +22 -11
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #include <errno.h>
 #include <string.h>
 #include <sys/types.h>
@@ -14,8 +25,8 @@
 #include <openais/cpg.h>
 #include <openais/saCkpt.h>
 
-#include "linux/dm-log-userspace.h"
-#include <libdevmapper.h>
+#include "dm-log-userspace.h"
+#include "libdevmapper.h"
 #include "functions.h"
 #include "local.h"
 #include "common.h"
@@ -133,7 +144,7 @@
 	int count=0;
 	int found;
 	struct iovec iov;
-	struct clog_cpg *entry, *tmp;
+	struct clog_cpg *entry;
 
 	dm_list_iterate_items(entry, &clog_cpg_list)
 		if (!strncmp(entry->name.value, rq->u_rq.uuid,
@@ -263,7 +274,7 @@
 				   struct clog_request *rq)
 {
 	int r = 0;
-	struct clog_request *orig_rq, *n;
+	struct clog_request *orig_rq;
 
 	/*
 	 * If I didn't send it, then I don't care about the response
@@ -317,7 +328,7 @@
 
 static struct clog_cpg *find_clog_cpg(cpg_handle_t handle)
 {
-	struct clog_cpg *match, *tmp;
+	struct clog_cpg *match;
 
 	dm_list_iterate_items(match, &clog_cpg_list)
 		if (match->handle == handle)
@@ -852,7 +863,7 @@
 static int do_cluster_work(void *data)
 {
 	int r = SA_AIS_OK;
-	struct clog_cpg *entry, *tmp;
+	struct clog_cpg *entry;
 
 	dm_list_iterate_items(entry, &clog_cpg_list) {
 		r = cpg_dispatch(entry->handle, CPG_DISPATCH_ALL);
@@ -930,7 +941,7 @@
 	int i_am_server;
 	int response = 0;
 	struct clog_request *rq = msg;
-	struct clog_request *tmp_rq, *n;
+	struct clog_request *tmp_rq;
 	struct clog_cpg *match;
 
 	match = find_clog_cpg(handle);
@@ -1363,7 +1374,7 @@
 				struct cpg_address *joined_list,
 				int joined_list_entries)
 {
-	struct clog_cpg *match, *tmp;
+	struct clog_cpg *match;
 	int found = 0;
 
 	dm_list_iterate_items(match, &clog_cpg_list)
@@ -1448,7 +1459,7 @@
 	int r;
 	int size;
 	struct clog_cpg *new = NULL;
-	struct clog_cpg *tmp, *tmp2;
+	struct clog_cpg *tmp;
 
 	dm_list_iterate_items(tmp, &clog_cpg_list)
 		if (!strncmp(tmp->name.value, uuid, CPG_MAX_NAME_LENGTH)) {
@@ -1603,8 +1614,8 @@
 void cluster_debug(void)
 {
 	struct checkpoint_data *cp;
-	struct clog_cpg *entry, *tmp;
-	struct clog_request *rq, *n;
+	struct clog_cpg *entry;
+	struct clog_request *rq;
 	int i;
 
 	LOG_ERROR("");
daemons/clogd/cluster.h +13 -2
@@ -1,8 +1,19 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #ifndef __CLUSTER_LOG_CLUSTER_DOT_H__
 #define __CLUSTER_LOG_CLUSTER_DOT_H__
 
-#include <libdevmapper.h>
-#include <linux/dm-log-userspace.h>
+#include "libdevmapper.h"
+#include "dm-log-userspace.h"
 
 /*
  * There is other information in addition to what can
daemons/clogd/common.h +11 -0
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #ifndef __CLUSTER_LOG_COMMON_DOT_H__
 #define __CLUSTER_LOG_COMMON_DOT_H__
 
daemons/clogd/functions.c +58 -48

257 lines not on this page · raw message

daemons/clogd/functions.h +12 -1
@@ -1,7 +1,18 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #ifndef __CLOG_FUNCTIONS_DOT_H__
 #define __CLOG_FUNCTIONS_DOT_H__
 
-#include <linux/dm-log-userspace.h>
+#include "dm-log-userspace.h"
 #include "cluster.h"
 
 #define LOG_RESUMED   1
daemons/clogd/link_mon.c +11 -0
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #include <stdlib.h>
 #include <errno.h>
 #include <poll.h>
daemons/clogd/link_mon.h +11 -0
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #ifndef __LINK_MON_DOT_H__
 #define __LINK_MON_DOT_H__
 
daemons/clogd/local.c +18 -1
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
@@ -8,7 +19,7 @@
 #include <linux/connector.h>
 #include <linux/netlink.h>
 
-#include "linux/dm-log-userspace.h"
+#include "dm-log-userspace.h"
 #include "functions.h"
 #include "cluster.h"
 #include "common.h"
@@ -16,6 +27,12 @@
 #include "link_mon.h"
 #include "local.h"
 
+#ifndef CN_IDX_DM
+#warning Kernel should be at least 2.6.31
+#define CN_IDX_DM                       0x7     /* Device Mapper */
+#define CN_VAL_DM_USERSPACE_LOG         0x1
+#endif
+
 static int cn_fd;  /* Connector (netlink) socket fd */
 static char recv_buf[2048];
 static char send_buf[2048];
daemons/clogd/local.h +11 -0
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #ifndef __CLUSTER_LOG_LOCAL_DOT_H__
 #define __CLUSTER_LOG_LOCAL_DOT_H__
 
daemons/clogd/logging.c +11 -0
@@ -1,3 +1,14 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 #include <stdio.h>
 #include <syslog.h>
 
daemons/clogd/logging.h +12 -0
@@ -1,3 +1,15 @@
+/*
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifndef __CLUSTER_LOG_LOGGING_DOT_H__
 #define __CLUSTER_LOG_LOGGING_DOT_H__