Skip to contentSkip to conversation

LVM2/daemons/clogd Makefile clogd.c cluster.c ...

PATCH [email protected] 1 participant 1 message Jan 8, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2009-01-08 17:12:33

Added files:
daemons/clogd : Makefile clogd.c cluster.c cluster.h common.h
functions.c functions.h link_mon.c link_mon.h list.h local.c local.h logging.c logging.h

Log message:
Initial import of the cluster log daemon from the 'cluster' repository.

There is a rudimentary make file in place so people can build by hand from 'LVM2/daemons/clogd'. It is not hooked into the main build system yet. I am checking this in to provide people better access to the source code.

There is still work to be done to make better use of existing code in the LVM repository. (list.h could be removed in favor of existing list implementations, for example. Logging might also be removed in favor of what is already in the tree.)

I will probably defer updating WHATS_NEW_DM until this code is linked into the main build system (unless otherwise instructed).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/Makefile.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/clogd.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/cluster.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/cluster.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/common.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/functions.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/functions.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/link_mon.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/link_mon.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/list.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/local.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/local.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/logging.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/logging.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1

/cvs/lvm2/LVM2/daemons/clogd/Makefile,v --> standard output revision 1.1

- renamed from daemons/clogd/Makefile +77 -0
@@ -0,0 +1,77 @@
+###############################################################################
+###############################################################################
+##
+##  Copyright (C) 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.
+##
+###############################################################################
+###############################################################################
+
+SOURCES = clogd.c cluster.c functions.c link_mon.c local.c logging.c
+
+TARGET = $(shell if [ ! -e /usr/include/linux/dm-clog-tfr.h ]; then \
+		echo 'no_clogd_kernel_headers'; \
+	elif [ ! -e /usr/include/linux/ext2_fs.h ]; then \
+		echo 'no_e2fsprogs_devel'; \
+	elif [ ! -e /usr/include/openais/saCkpt.h ]; then \
+		echo 'no_openais_devel'; \
+	else \
+		echo 'clogd'; \
+	fi)
+
+ifneq ($(DEBUG), )
+CFLAGS += -DDEBUG
+endif
+
+ifneq ($(MEMB), )
+CFLAGS += -DMEMB
+endif
+
+ifneq ($(CKPT), )
+CFLAGS += -DCKPT
+endif
+
+ifneq ($(RESEND), )
+CFLAGS += -DRESEND
+endif
+
+CFLAGS += -g
+
+LDFLAGS += $(shell if [ -e /usr/lib64/openais ]; then \
+		echo '-L/usr/lib64/openais -L/usr/lib64'; \
+	else \
+		echo '-L/usr/lib/openais -L/usr/lib'; \
+	fi)
+LDFLAGS += -lcpg -lSaCkpt -lext2fs
+
+all: ${TARGET}
+
+clogd: ${SOURCES}
+	${CC} ${CFLAGS} -o $@ $^ ${LDFLAGS}
+
+no_clogd_kernel_headers:
+	echo "Unable to find clogd kernel headers"
+	exit 1
+
+no_e2fsprogs_devel:
+	echo "Unable to find ext2fs kernel headers."
+	echo "Install 'e2fsprogs-devel'?"
+	exit 1
+
+no_openais_devel:
+	echo "Unable to find openAIS headers."
+	echo "http://sources.redhat.com/cluster/wiki/"
+	exit 1
+
+install: clogd
+	install -d /usr/sbin
+	install clogd /usr/sbin
+
+uninstall:
+	rm /usr/sbin/clogd
+
+clean:
+	rm -f *.o clogd *~

/cvs/lvm2/LVM2/daemons/clogd/clogd.c,v --> standard output revision 1.1

- renamed from daemons/clogd/clogd.c +283 -0

283 lines not on this page · raw message

/cvs/lvm2/LVM2/daemons/clogd/cluster.c,v --> standard output revision 1.1

- renamed from daemons/clogd/cluster.c +1551 -0

1,551 lines not on this page · raw message

/cvs/lvm2/LVM2/daemons/clogd/cluster.h,v --> standard output revision 1.1

- renamed from daemons/clogd/cluster.h +13 -0
@@ -0,0 +1,13 @@
+#ifndef __CLUSTER_LOG_CLUSTER_DOT_H__
+#define __CLUSTER_LOG_CLUSTER_DOT_H__
+
+int init_cluster(void);
+void cleanup_cluster(void);
+void cluster_debug(void);
+
+int create_cluster_cpg(char *str);
+int destroy_cluster_cpg(char *str);
+
+int cluster_send(struct clog_tfr *tfr);
+
+#endif /* __CLUSTER_LOG_CLUSTER_DOT_H__ */

/cvs/lvm2/LVM2/daemons/clogd/common.h,v --> standard output revision 1.1

- renamed from daemons/clogd/common.h +40 -0
@@ -0,0 +1,40 @@
+#ifndef __CLUSTER_LOG_COMMON_DOT_H__
+#define __CLUSTER_LOG_COMMON_DOT_H__
+
+/*
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+*/
+
+#define EXIT_LOCKFILE              2
+
+#define EXIT_KERNEL_TFR_SOCKET     3 /* Failed netlink socket create */
+#define EXIT_KERNEL_TFR_BIND       4
+#define EXIT_KERNEL_TFR_SETSOCKOPT 5
+
+#define EXIT_CLUSTER_CKPT_INIT     6 /* Failed to init checkpoint */
+
+#define EXIT_QUEUE_NOMEM           7
+
+/* Located in dm-clog-tfr.h
+#define RQ_TYPE(x) \
+	((x) == DM_CLOG_CTR) ? "DM_CLOG_CTR" : \
+	((x) == DM_CLOG_DTR) ? "DM_CLOG_DTR" : \
+	((x) == DM_CLOG_PRESUSPEND) ? "DM_CLOG_PRESUSPEND" : \
+	((x) == DM_CLOG_POSTSUSPEND) ? "DM_CLOG_POSTSUSPEND" : \
+	((x) == DM_CLOG_RESUME) ? "DM_CLOG_RESUME" : \
+	((x) == DM_CLOG_GET_REGION_SIZE) ? "DM_CLOG_GET_REGION_SIZE" : \
+	((x) == DM_CLOG_IS_CLEAN) ? "DM_CLOG_IS_CLEAN" : \
+	((x) == DM_CLOG_IN_SYNC) ? "DM_CLOG_IN_SYNC" : \
+	((x) == DM_CLOG_FLUSH) ? "DM_CLOG_FLUSH" : \
+	((x) == DM_CLOG_MARK_REGION) ? "DM_CLOG_MARK_REGION" : \
+	((x) == DM_CLOG_CLEAR_REGION) ? "DM_CLOG_CLEAR_REGION" : \
+	((x) == DM_CLOG_GET_RESYNC_WORK) ? "DM_CLOG_GET_RESYNC_WORK" : \
+	((x) == DM_CLOG_SET_REGION_SYNC) ? "DM_CLOG_SET_REGION_SYNC" : \
+	((x) == DM_CLOG_GET_SYNC_COUNT) ? "DM_CLOG_GET_SYNC_COUNT" : \
+	((x) == DM_CLOG_STATUS_INFO) ? "DM_CLOG_STATUS_INFO" : \
+	((x) == DM_CLOG_STATUS_TABLE) ? "DM_CLOG_STATUS_TABLE" : \
+	NULL
+*/
+
+#endif /* __CLUSTER_LOG_COMMON_DOT_H__ */

/cvs/lvm2/LVM2/daemons/clogd/functions.c,v --> standard output revision 1.1

- renamed from daemons/clogd/functions.c +1788 -0

1,036 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/functions.h,v --> standard output revision 1.1

- renamed from daemons/clogd/functions.h +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/link_mon.c,v --> standard output revision 1.1

- renamed from daemons/clogd/link_mon.c +138 -0

138 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/link_mon.h,v --> standard output revision 1.1

- renamed from daemons/clogd/link_mon.h +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/list.h,v --> standard output revision 1.1

- renamed from daemons/clogd/list.h +471 -0

471 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/local.c,v --> standard output revision 1.1

- renamed from daemons/clogd/local.c +379 -0

379 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/local.h,v --> standard output revision 1.1

- renamed from daemons/clogd/local.h +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/logging.c,v --> standard output revision 1.1

- renamed from daemons/clogd/logging.c +25 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

/cvs/lvm2/LVM2/daemons/clogd/logging.h,v --> standard output revision 1.1

- renamed from daemons/clogd/logging.h +81 -0

81 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.