[Ocfs2-commits] jlbec commits r1734 - trunk/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Dec 30 17:19:18 CST 2004


Author: jlbec
Date: 2004-12-30 17:19:16 -0600 (Thu, 30 Dec 2004)
New Revision: 1734

Added:
   trunk/cluster/ocfs2_heartbeat.h
   trunk/cluster/ocfs2_nodemanager.h
   trunk/cluster/ocfs2_tcp.h
Modified:
   trunk/cluster/
   trunk/cluster/heartbeat.h
   trunk/cluster/nodemanager.h
   trunk/cluster/tcp.h
Log:

o Copy over the libo2cb/include headers.
o Make the regular headers include the libo2cb ones.  This means that
  the actual kernel<->user stuff is in proper headers.




Property changes on: trunk/cluster
___________________________________________________________________
Name: svn:ignore
   + *.sw?
stamp-md5
.*.cmd
*.ko
.tmp_versions
.*.d
*.mod.c


Modified: trunk/cluster/heartbeat.h
===================================================================
--- trunk/cluster/heartbeat.h	2004-12-30 23:08:52 UTC (rev 1733)
+++ trunk/cluster/heartbeat.h	2004-12-30 23:19:16 UTC (rev 1734)
@@ -28,6 +28,7 @@
 #ifndef CLUSTER_HEARTBEAT_H
 #define CLUSTER_HEARTBEAT_H
 
+#include "ocfs2_heartbeat.h"
 
 enum {
 	HB_NODE_STATE_INIT = 0,
@@ -55,26 +56,7 @@
 #define HB_THREAD_MS                  2000   // every 2 seconds
 
 
-#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;
-	u32 fd;
-	char disk_uuid[CLUSTER_DISK_UUID_LEN+1];
-	char pad1[15];
-	u16 group_num;
-	u32 bits;
-	u32 blocks;
-	u64 start;
-} hb_op;
-
-enum {
 	HB_TYPE_DISK = 0,
 	HB_TYPE_NET
 };
@@ -106,12 +88,7 @@
 	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

Modified: trunk/cluster/nodemanager.h
===================================================================
--- trunk/cluster/nodemanager.h	2004-12-30 23:08:52 UTC (rev 1733)
+++ trunk/cluster/nodemanager.h	2004-12-30 23:19:16 UTC (rev 1734)
@@ -30,23 +30,13 @@
 
 #define NM_ASSERT(x)       ({  if (!(x)) { printk("nm: assert failed! %s:%d\n", __FILE__, __LINE__); BUG(); } })
 
+#include "ocfs2_nodemanager.h"
 
 struct _nm_ctxt
 {
 	int dummy;
 };
 
-#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
@@ -64,30 +54,6 @@
 	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;
-	__u16 pad1;
-	__u32 pad2;
-	char node_name[NM_MAX_NAME_LEN+1];
-	char pad3[63];
-	nm_network_iface ifaces[NM_MAX_IFACES];
-} nm_node_info;
-
-
 typedef struct _nm_cluster
 {
 	char name[NM_MAX_NAME_LEN+1];
@@ -109,7 +75,6 @@
 	u32 slot_bitmap[8];
 } nm_group_inode_private;
 
-#ifdef __KERNEL__
 /* TODO: move this */
 #define NET_FLAG_CREATING_SOCKET   0x00000001
 typedef struct _net_inode_private
@@ -129,47 +94,8 @@
 	struct list_head ip_hash;
 	net_inode_private net;
 } nm_node_inode_private;
-#endif
 
-/* 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;
-	__u32 pad1;
-	union {
-		u16 index;
-		char name[NM_MAX_NAME_LEN+1];
-		nm_node_info node;
-		nm_group_change gc;
-	} arg_u;
-} nm_op;
-
-
 /* callback stuff */
 
 enum {
@@ -209,9 +135,7 @@
 
 extern char *nm_nodename;
 
-#ifdef __KERNEL__
 
-
 struct inode * nm_get_group_by_num(u16 group_num);
 struct inode * nm_get_node_by_num(u16 node_num);
 struct inode * __nm_get_node_by_name(char *node_name, int dir);
@@ -236,7 +160,6 @@
 {
 	return (group->i_ino - NM_GROUP_INODE_START);
 }
-#endif
 
 static inline int nm_valid_ino(int ino)
 {

Added: trunk/cluster/ocfs2_heartbeat.h
===================================================================
--- trunk/cluster/ocfs2_heartbeat.h	2004-12-30 23:08:52 UTC (rev 1733)
+++ trunk/cluster/ocfs2_heartbeat.h	2004-12-30 23:19:16 UTC (rev 1734)
@@ -0,0 +1,54 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * ocfs2_heartbeat.h
+ *
+ * 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.
+ */
+
+#ifndef _OCFS2_HEARTBEAT_H
+#define _OCFS2_HEARTBEAT_H
+
+#define CLUSTER_DISK_UUID_LEN      32      // 16 byte binary == 32 char hex string
+
+
+#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;
+	__u32 fd;
+	char disk_uuid[CLUSTER_DISK_UUID_LEN+1];
+	char pad1[15];  /* Pad to the __u16 following it */
+	__u16 group_num;
+	__u32 bits;
+	__u32 blocks;
+	__u64 start;
+} hb_op;
+
+typedef struct _hb_disk_heartbeat_block
+{
+	__u64 time;
+} hb_disk_heartbeat_block;
+
+#endif /* _OCFS2_HEARTBEAT_H */

Added: trunk/cluster/ocfs2_nodemanager.h
===================================================================
--- trunk/cluster/ocfs2_nodemanager.h	2004-12-30 23:08:52 UTC (rev 1733)
+++ trunk/cluster/ocfs2_nodemanager.h	2004-12-30 23:19:16 UTC (rev 1734)
@@ -0,0 +1,103 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * ocfs2_nodemanager.h
+ *
+ * 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 _OCFS2_NODEMANAGER_H
+#define _OCFS2_NODEMANAGER_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
+
+
+
+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;
+	__u16 pad1;
+	__u32 pad2;
+	char node_name[NM_MAX_NAME_LEN+1];
+	char pad3[63];
+	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;
+	__u32 pad1;
+	union {
+		__u16 index;
+		char name[NM_MAX_NAME_LEN+1];
+		nm_node_info node;
+		nm_group_change gc;
+	} arg_u;
+} nm_op;
+
+#endif /* _OCFS2_NODEMANAGER_H */

Added: trunk/cluster/ocfs2_tcp.h
===================================================================
--- trunk/cluster/ocfs2_tcp.h	2004-12-30 23:08:52 UTC (rev 1733)
+++ trunk/cluster/ocfs2_tcp.h	2004-12-30 23:19:16 UTC (rev 1734)
@@ -0,0 +1,46 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * ocfs2_tcp.h
+ *
+ * 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.
+ */
+
+#ifndef _OCFS2_TCP_H
+#define _OCFS2_TCP_H
+
+typedef struct _gsd_ioc
+{
+	int fd;
+	int namelen;
+	char name[NM_MAX_NAME_LEN+1];
+	int status;
+} gsd_ioc;
+
+typedef struct _net_ioc
+{
+	__u32 status;
+} net_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)
+
+#endif /* _OCFS2_TCP_H */

Modified: trunk/cluster/tcp.h
===================================================================
--- trunk/cluster/tcp.h	2004-12-30 23:08:52 UTC (rev 1733)
+++ trunk/cluster/tcp.h	2004-12-30 23:19:16 UTC (rev 1734)
@@ -39,10 +39,9 @@
 #include <linux/in.h>
 
 #include "nodemanager.h"
+#include "ocfs2_tcp.h"
 
 
-#ifdef __KERNEL__
-
 #define NET_DISP_THREAD_MS   5000   /* TODO */
 #define NET_RECV_THREAD_MS   5000   /* TODO */
 
@@ -211,27 +210,6 @@
 int net_broadcast_message(u32 msg_type, u32 key, void *data, u32 len, struct inode *group);
 net_msg_handler * net_lookup_handler(u32 msg_type, u32 key);
 
-#endif /* __KERNEL__ */
-
-typedef struct _net_ioc
-{
-	u32 status;
-} net_ioc;
-
-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)



More information about the Ocfs2-commits mailing list