Skip to contentSkip to conversation

dm-log-cluster.patch

PATCH New Jonathan Brassow 1 participant 1 message Jan 27, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm-log-cluster.patch

This patch includes changes that I missed when changing the file names; and supersedes the previous patch.

brassow

This patch contains a cluster-aware log module. When used by dm-raid1, device-mapper mirroring can be cluster-aware.

There is a kernel component (provided in this patch) and a user space component. The kernel component implements the logging interface and passes all requests to userspace via 'connector' (a netlink wrapper). The userspace daemon is built upon OpenAIS for cluster communication and is fault tolerant.

drivers/md/Kconfig +10 -0
Index: linux-2.6/drivers/md/Kconfig
===================================================================
@@ -256,6 +256,16 @@ config DM_MIRROR
          Allow volume managers to mirror logical volumes, also
          needed for live data migration tools such as 'pvmove'.
 
+config DM_LOG_CLUSTERED
+	tristate "Mirror cluster logging (EXPERIMENTAL)"
+	depends on DM_MIRROR && EXPERIMENTAL
+	select CONNECTOR
+	---help---
+	  Cluster logging allows device-mapper mirroring to be
+	  cluster-aware.  Mirror devices can be used by multiple
+	  machines at the same time.  Note: this will not make
+	  your applications cluster-aware.
+
 config DM_ZERO
 	tristate "Zero target"
 	depends on BLK_DEV_DM
drivers/md/Makefile +2 -0
Index: linux-2.6/drivers/md/Makefile
===================================================================
@@ -8,6 +8,7 @@ dm-multipath-objs := dm-path-selector.o 
 dm-snapshot-objs := dm-snap.o dm-exception-store.o dm-snap-transient.o \
 		    dm-snap-persistent.o
 dm-mirror-objs	:= dm-raid1.o
+dm-log-clustered-objs := dm-log-cluster.o dm-log-cluster-transfer.o
 md-mod-objs     := md.o bitmap.o
 raid456-objs	:= raid5.o raid6algos.o raid6recov.o raid6tables.o \
 		   raid6int1.o raid6int2.o raid6int4.o \
@@ -36,6 +37,7 @@ obj-$(CONFIG_DM_DELAY)		+= dm-delay.o
 obj-$(CONFIG_DM_MULTIPATH)	+= dm-multipath.o dm-round-robin.o
 obj-$(CONFIG_DM_SNAPSHOT)	+= dm-snapshot.o
 obj-$(CONFIG_DM_MIRROR)		+= dm-mirror.o dm-log.o dm-region-hash.o
+obj-$(CONFIG_DM_LOG_CLUSTERED)	+= dm-log-clustered.o
 obj-$(CONFIG_DM_ZERO)		+= dm-zero.o
 
 quiet_cmd_unroll = UNROLL  $@
include/linux/connector.h +3 -1
Index: linux-2.6/include/linux/connector.h
===================================================================
@@ -39,8 +39,10 @@
 #define CN_IDX_V86D			0x4
 #define CN_VAL_V86D_UVESAFB		0x1
 #define CN_IDX_BB			0x5	/* BlackBoard, from the TSP GPL sampling framework */
+#define CN_IDX_DM			0x6     /* Device Mapper */
+#define CN_VAL_DM_CLUSTER_LOG		0x1
 
-#define CN_NETLINK_USERS		6
+#define CN_NETLINK_USERS		7
 
 /*
  * Maximum connector's message size.
include/linux/dm-log-cluster.h new file +67 -0

67 lines not on this page · raw message

drivers/md/dm-log-cluster-transfer.c new file +280 -0

280 lines not on this page · raw message

drivers/md/dm-log-cluster-transfer.h new file +18 -0
Index: linux-2.6/drivers/md/dm-log-cluster-transfer.h
===================================================================
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2006-2009 Red Hat, Inc.
+ *
+ * This file is released under the LGPL.
+ */
+
+#ifndef __DM_LOG_CLUSTER_TRANSFER_H__
+#define __DM_LOG_CLUSTER_TRANSFER_H__
+
+#define DM_MSG_PREFIX "dm-log-clustered"
+
+int dm_clog_tfr_init(void);
+void dm_clog_tfr_exit(void);
+int dm_clog_consult_server(const char *uuid, int request_type,
+			   char *data, int data_size,
+			   char *rdata, int *rdata_size);
+
+#endif /* __DM_LOG_CLUSTER_TRANSFER_H__ */
drivers/md/dm-log-cluster.c new file +796 -0

796 lines not on this page · raw message