[Ocfs2-tools-commits] mfasheh commits r461 - in branches/dlm-glue: . libocfs2cluster libocfs2cluster/include

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Dec 3 21:00:45 CST 2004


Author: mfasheh
Date: 2004-12-03 21:00:43 -0600 (Fri, 03 Dec 2004)
New Revision: 461

Added:
   branches/dlm-glue/libocfs2cluster/
   branches/dlm-glue/libocfs2cluster/README
   branches/dlm-glue/libocfs2cluster/TODO
   branches/dlm-glue/libocfs2cluster/include/
   branches/dlm-glue/libocfs2cluster/include/ocfs2_heartbeat.h
   branches/dlm-glue/libocfs2cluster/include/ocfs2_nodemanager.h
   branches/dlm-glue/libocfs2cluster/include/ocfs2_tcp.h
Log:
* add the missing header files now



Added: branches/dlm-glue/libocfs2cluster/README
===================================================================
--- branches/dlm-glue/libocfs2cluster/README	2004-12-04 02:56:28 UTC (rev 460)
+++ branches/dlm-glue/libocfs2cluster/README	2004-12-04 03:00:43 UTC (rev 461)
@@ -0,0 +1,16 @@
+Here's how to get the basics working:
+  * plunk down otcp.o, onm.o, ohb.o and odlm.o somewhere in your
+      module path and run depmod (or better yet, symlink each to
+      your build tree and run depmod -ar)
+  * make an /etc/cluster.conf.  example:
+	cluster_name=foofers
+	0,ca-test31,139.185.118.131,8765
+	1,ca-test32,139.185.118.132,7654
+	2,ca-test33,139.185.118.133,9977
+    the node format is <nodenum>,<nodename>,<ip>,<port>
+  * run clusterbo as root
+  * run "mount -t ocfs2 /dev/device /mount/point"
+    -o options: hbdev=different-device -or-
+                hbuuid=different-uuid
+                to heartbeat on a different device than
+                the one you are mounting

Added: branches/dlm-glue/libocfs2cluster/TODO
===================================================================
--- branches/dlm-glue/libocfs2cluster/TODO	2004-12-04 02:56:28 UTC (rev 460)
+++ branches/dlm-glue/libocfs2cluster/TODO	2004-12-04 03:00:43 UTC (rev 461)
@@ -0,0 +1,7 @@
+* change the name and/or path of /etc/cluster.conf to something friendlier
+  maybe /etc/sysconfig/cluster/xxxx or similar
+* change the cluster.conf format to jlbec's stanza style
+* harden the tools for setuid-ness
+* fix mount.ocfs2 to handle other normal mount options appropriately (at least
+  handle rw, which is passed magically by /sbin/mount)
+

Added: branches/dlm-glue/libocfs2cluster/include/ocfs2_heartbeat.h
===================================================================
--- branches/dlm-glue/libocfs2cluster/include/ocfs2_heartbeat.h	2004-12-04 02:56:28 UTC (rev 460)
+++ branches/dlm-glue/libocfs2cluster/include/ocfs2_heartbeat.h	2004-12-04 03:00:43 UTC (rev 461)
@@ -0,0 +1,94 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmhb.h
+ *
+ * Function prototypes
+ *
+ * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ * 
+ * This program 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
+ * General Public License for more details.
+ * 
+ * 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 021110-1307, USA.
+ *
+ * Authors: Kurt Hackel, Mark Fasheh, Sunil Mushran, Wim Coekaerts,
+ *	    Manish Singh, Neeraj Goyal, Suchit Kaura
+ */
+
+#ifndef DLMHB_H
+#define DLMHB_H
+
+#define CLUSTER_DISK_UUID_LEN      32      // 16 byte binary == 32 char hex string
+
+enum {
+	HB_NODE_STATE_INIT = 0,
+	HB_NODE_STATE_DOWN,
+	HB_NODE_STATE_UP
+};
+
+
+#define HB_OP_MAGIC      0xf00d
+enum {
+	HB_OP_START_DISK_HEARTBEAT=371,
+	HB_OP_GET_NODE_MAP
+};
+
+typedef struct _hb_op
+{
+	u16 magic;
+	u16 opcode;
+	unsigned int fd;
+	char disk_uuid[CLUSTER_DISK_UUID_LEN+1];
+	u16 group_num;
+	u32 bits;
+	u32 blocks;
+	u64 start;
+} hb_op;
+
+enum {
+	HB_TYPE_DISK = 0,
+	HB_TYPE_NET
+};
+
+
+/* callback stuff */
+
+enum {
+	HB_NODE_DOWN_CB = 0,
+	HB_NODE_UP_CB,
+	HB_NODE_RESPONDED_CB,    // this one is very chatty
+	HB_NUM_CB
+};
+
+enum {
+	HB_Root = 1,
+	HB_Disk,
+	HB_WriteOpArraySize
+};
+
+typedef struct _hb_disk_heartbeat_block
+{
+	u64 time;
+} hb_disk_heartbeat_block;
+
+
+// number of initial allowed misses 
+#define HB_INITIAL_DISK_MARGIN     60
+#define HB_INITIAL_NET_MARGIN      60
+
+// number of allowed misses in steady state
+#define HB_DISK_MARGIN             30
+#define HB_NET_MARGIN              30
+
+#endif /* DLMHB_H */

Added: branches/dlm-glue/libocfs2cluster/include/ocfs2_nodemanager.h
===================================================================
--- branches/dlm-glue/libocfs2cluster/include/ocfs2_nodemanager.h	2004-12-04 02:56:28 UTC (rev 460)
+++ branches/dlm-glue/libocfs2cluster/include/ocfs2_nodemanager.h	2004-12-04 03:00:43 UTC (rev 461)
@@ -0,0 +1,119 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmnm.h
+ *
+ * Function prototypes
+ *
+ * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ * 
+ * This program 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
+ * General Public License for more details.
+ * 
+ * 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 021110-1307, USA.
+ *
+ * Authors: Kurt Hackel, Mark Fasheh, Sunil Mushran, Wim Coekaerts,
+ *	    Manish Singh, Neeraj Goyal, Suchit Kaura
+ */
+
+#ifndef DLMNM_H
+#define DLMNM_H
+
+#include "ocfs2_heartbeat.h"
+
+#define NM_MAX_IFACES            2
+#define NM_MAX_NODES             255
+#define NM_INVALID_SLOT_NUM      255
+
+/* host name, group name, cluster name all 64 bytes */
+#define NM_MAX_NAME_LEN          64    // __NEW_UTS_LEN
+
+
+#define NM_GROUP_INODE_START    200000
+#define NM_NODE_INODE_START     100000
+
+enum {
+	NM_CLUSTER_DOWN=0,
+	NM_CLUSTER_UP
+};
+
+enum {
+	NM_GROUP_NOT_READY=0,
+	NM_GROUP_READY
+};
+
+enum {
+	NM_Root = 1,
+	NM_Cluster,
+	NM_Node,
+	NM_Group,
+};
+
+
+
+
+typedef struct _nm_network_iface
+{
+	u16 ip_port;			/* for simplicity, just define exactly one port for this if */
+	u16 ip_version;
+	union {
+		u32 ip_addr4;		/* IPv4 address in NBO */
+		u32 ip_addr6[4];	/* IPv6 address in NBO */
+	} addr_u;
+} nm_network_iface;
+
+typedef struct _nm_node_info 
+{
+	u16 node_num;
+	char node_name[NM_MAX_NAME_LEN+1];
+	nm_network_iface ifaces[NM_MAX_IFACES];
+} nm_node_info;
+
+/* transaction file nm_op stuff */
+
+#define NM_OP_MAGIC      0xbeaf
+enum {
+	NM_OP_CREATE_CLUSTER=123,
+	NM_OP_DESTROY_CLUSTER,
+	NM_OP_NAME_CLUSTER,
+	NM_OP_ADD_CLUSTER_NODE,
+	NM_OP_GET_CLUSTER_NUM_NODES,
+	NM_OP_GET_NODE_INFO,
+	NM_OP_CREATE_GROUP,
+	NM_OP_GET_GROUP_INFO,
+	NM_OP_ADD_GROUP_NODE,
+	NM_OP_GET_GLOBAL_NODE_NUM
+};
+
+typedef struct _nm_group_change
+{
+	u16 group_num;
+	u16 node_num;
+	u16 slot_num;
+	char disk_uuid[CLUSTER_DISK_UUID_LEN+1];
+	char name[NM_MAX_NAME_LEN+1];
+} nm_group_change;
+
+typedef struct _nm_op
+{
+	u16 magic;
+	u16 opcode;
+	union {
+		u16 index;
+		char name[NM_MAX_NAME_LEN+1];
+		nm_node_info node;
+		nm_group_change gc;
+	} arg_u;
+} nm_op;
+
+#endif /* DLMNM_H */

Added: branches/dlm-glue/libocfs2cluster/include/ocfs2_tcp.h
===================================================================
--- branches/dlm-glue/libocfs2cluster/include/ocfs2_tcp.h	2004-12-04 02:56:28 UTC (rev 460)
+++ branches/dlm-glue/libocfs2cluster/include/ocfs2_tcp.h	2004-12-04 03:00:43 UTC (rev 461)
@@ -0,0 +1,61 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmtcp.h
+ *
+ * Function prototypes
+ *
+ * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ * 
+ * This program 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
+ * General Public License for more details.
+ * 
+ * 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 021110-1307, USA.
+ *
+ * Authors: Kurt Hackel, Mark Fasheh, Sunil Mushran, Wim Coekaerts,
+ *	    Manish Singh, Neeraj Goyal, Suchit Kaura
+ */
+
+#ifndef DLMNET_H
+#define DLMNET_H
+#include <linux/socket.h>
+#include <sys/socket.h>
+#include <linux/inet.h>
+#include <linux/in.h>
+
+typedef struct _gsd_ioc
+{
+	int fd;
+	int namelen;
+	char name[NM_MAX_NAME_LEN+1];
+	int status;
+} gsd_ioc;
+
+#define  NET_IOC_MAGIC          'O'
+#define  NET_IOC_ACTIVATE       _IOR(NET_IOC_MAGIC, 1, net_ioc)
+#define  NET_IOC_GETSTATE       _IOR(NET_IOC_MAGIC, 2, net_ioc)
+#define  GSD_IOC_CREATE_GROUP   _IOR(NET_IOC_MAGIC, 3, gsd_ioc)
+#define  GSD_IOC_ADD_GROUP_NODE _IOR(NET_IOC_MAGIC, 4, gsd_ioc)
+
+#define GSD_MESSAGE   130
+#define GSD_ACTION_ADD_GROUP        (0x01)
+#define GSD_ACTION_ADD_GROUP_NODE   (0x02)
+typedef struct _gsd_message
+{
+	u16 from;
+	u8 action;
+	u8 namelen;
+	u8 name[NM_MAX_NAME_LEN];
+} gsd_message;
+
+#endif /* DLMNET_H */



More information about the Ocfs2-tools-commits mailing list