Skip to contentSkip to conversation

cluster/cmirror/src clogd.c cluster.c function ...

Cluster-devel [email protected] 1 participant 1 message Feb 6, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: jbrassow at sourceware.org 2008-02-06 23:03:05

Modified files:
cmirror/src : clogd.c cluster.c functions.c functions.h
local.c queues.c queues.h

Log message:
- change verbosity of various messages
- fix bug where similtaneous mirror creations could result in checkpoint collisions

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/clogd.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.5&r2=1.1.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/cluster.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.14&r2=1.1.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/functions.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.12&r2=1.1.2.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/functions.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/local.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.12&r2=1.1.2.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/queues.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.5&r2=1.1.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/queues.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.3&r2=1.1.2.4

cmirror/src/Attic/clogd.c +7 -2
@@ -120,9 +120,13 @@
 	case SIGQUIT:
 	case SIGTERM:
 	case SIGHUP:
-		r = queue_status();
-		r += log_status();
+		r = queue_status(0);
+		r += log_status(0);
 		break;
+	case SIGUSR1:
+		queue_status(1);
+		log_status(1);
+		return;
 	default:
 		LOG_PRINT("Unknown signal received... ignoring");
 		return;
@@ -229,6 +233,7 @@
 	signal(SIGTERM, &sig_handler);
 	signal(SIGHUP, &sig_handler);
 	signal(SIGPIPE, SIG_IGN);
+	signal(SIGUSR1, &sig_handler);
 	sigemptyset(&signal_mask);
 	signal_received = 0;
 }
cmirror/src/Attic/cluster.c +33 -16

132 lines not on this page · raw message

cmirror/src/Attic/functions.c +32 -26

129 lines not on this page · raw message

cmirror/src/Attic/functions.h +1 -1
@@ -13,5 +13,5 @@
 int store_bits(const char *uuid, const char *which, char **buf);
 int load_bits(const char *uuid, const char *which, char *buf, int size);
 int log_get_state(struct clog_tfr *tfr);
-int log_status(void);
+int log_status(int);
 #endif /* __CLOG_FUNCTIONS_DOT_H__ */
cmirror/src/Attic/local.c +3 -0
@@ -309,6 +309,9 @@
 		return EXIT_KERNEL_TFR_SOCKET;
 	}
 
+	/* memset to fix valgrind complaint */
+	memset(&addr, 0, sizeof(struct sockaddr_nl));
+
 	addr.nl_family = AF_NETLINK;
 	addr.nl_groups = 0x4;
 	addr.nl_pid = 0;
cmirror/src/Attic/queues.c +11 -9
@@ -79,21 +79,23 @@
 	return 0;
 }
 
-int queue_status(void)
+int queue_status(int output_wanted)
 {
 	int i=1;
 	struct clog_tfr *tfr;
 	struct list_head *p, *n;
 
-	LOG_DBG("cluster_queue: %d", cluster_queue->count);
-	list_for_each_safe(p, n, &cluster_queue->list) {
-		tfr = (struct clog_tfr *)p;
-		LOG_DBG("  %d) %s, originator = %u",
-			i++, RQ_TYPE(tfr->request_type),
-			tfr->originator);
-	}
+	if (output_wanted) {
+		LOG_PRINT("cluster_queue: %d", cluster_queue->count);
+		list_for_each_safe(p, n, &cluster_queue->list) {
+			tfr = (struct clog_tfr *)p;
+			LOG_PRINT("  %d) %s, originator = %u",
+				  i++, RQ_TYPE(tfr->request_type),
+				  tfr->originator);
+		}
 		
-	LOG_DBG("free_queue   : %d", free_queue->count);
+		LOG_PRINT("free_queue   : %d", free_queue->count);
+	}
 
 	return cluster_queue->count;
 }
cmirror/src/Attic/queues.h +1 -1
@@ -17,7 +17,7 @@
 
 int init_queues(void);
 void cleanup_queues(void);
-int queue_status(void);
+int queue_status(int);
 void queue_add_tail(struct clog_tfr *tfr, struct queue *q);
 void queue_add(struct clog_tfr *tfr, struct queue *q);
 struct clog_tfr *queue_remove(struct queue *q);