[Ocfs2-commits] khackel commits r1855 - in trunk/fs/ocfs2: cluster dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Jan 26 01:55:51 CST 2005


Author: khackel
Date: 2005-01-26 01:55:49 -0600 (Wed, 26 Jan 2005)
New Revision: 1855

Modified:
   trunk/fs/ocfs2/cluster/gsd.c
   trunk/fs/ocfs2/cluster/heartbeat.c
   trunk/fs/ocfs2/cluster/nodemanager.c
   trunk/fs/ocfs2/cluster/nodemanager.h
   trunk/fs/ocfs2/cluster/ocfs2_heartbeat.h
   trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h
   trunk/fs/ocfs2/cluster/tcp.c
   trunk/fs/ocfs2/cluster/tcp.h
   trunk/fs/ocfs2/dlm/dlmmaster.c
   trunk/fs/ocfs2/dlm/dlmmod.c
   trunk/fs/ocfs2/dlm/dlmmod.h
   trunk/fs/ocfs2/dlm/dlmrecovery.c
   trunk/fs/ocfs2/dlm/dlmthread.c
Log:
change all node and group numbers in cluster and dlm from u16 to u8 to put it in line with NM_MAX_NODES; requires tools revision 593 (for libo2cb and mount.ocfs2)

Modified: trunk/fs/ocfs2/cluster/gsd.c
===================================================================
--- trunk/fs/ocfs2/cluster/gsd.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/gsd.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -35,7 +35,7 @@
 
 static char *gsd_handler_buf = NULL;
 /* sigh.  these will be claned up, I'm just sure of it. */
-static u16 gsd_node_num;
+static u8 gsd_node_num;
 static struct inode *gsd_inode;
 
 static int gsd_message_action(gsd_message *g)

Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/heartbeat.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -80,10 +80,10 @@
 
 
 static void hb_teardown(void);
-static void hb_nm_group_node_add_cb(void *ptr1, void *ptr2, u16 idx);
-static void hb_nm_group_node_del_cb(void *ptr1, void *ptr2, u16 idx);
-static void hb_nm_node_add_cb(void *ptr1, void *ptr2, u16 idx);
-static void hb_nm_group_add_cb(void *ptr1, void *ptr2, u16 idx);
+static void hb_nm_group_node_add_cb(void *ptr1, void *ptr2, u8 idx);
+static void hb_nm_group_node_del_cb(void *ptr1, void *ptr2, u8 idx);
+static void hb_nm_node_add_cb(void *ptr1, void *ptr2, u8 idx);
+static void hb_nm_group_add_cb(void *ptr1, void *ptr2, u8 idx);
 static int hb_init_disk_hb_group(struct inode *group, dev_t dev, u32 bits, 
 				 u32 blocks, u64 start);
 static ssize_t write_disk(struct file *file, char *buf, size_t size);
@@ -643,7 +643,7 @@
 #endif
 
 /* TODO: make callbacks all return int */
-static void hb_nm_group_node_add_cb(void *ptr1, void *ptr2, u16 idx)
+static void hb_nm_group_node_add_cb(void *ptr1, void *ptr2, u8 idx)
 {
 	hb_disk_slot *slot;
 	struct inode *group = ptr1;
@@ -701,7 +701,7 @@
 	return;	
 }
 
-static void hb_nm_group_node_del_cb(void *ptr1, void *ptr2, u16 idx)
+static void hb_nm_group_node_del_cb(void *ptr1, void *ptr2, u8 idx)
 {
 	hb_disk_slot *slot;
 	struct inode *group = ptr1;
@@ -744,12 +744,12 @@
 	return;
 }
 
-static void hb_nm_node_add_cb(void *ptr1, void *ptr2, u16 idx)
+static void hb_nm_node_add_cb(void *ptr1, void *ptr2, u8 idx)
 {
 	//struct inode *node = ptr1;
 }
 
-static void hb_nm_group_add_cb(void *ptr1, void *ptr2, u16 idx)
+static void hb_nm_group_add_cb(void *ptr1, void *ptr2, u8 idx)
 {
 	struct inode *group = ptr1;
 	nm_group_inode_private *priv;

Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/nodemanager.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -162,7 +162,7 @@
 nm_cluster *nm_get_cluster(void);
 struct inode *nm_get_group_by_name(char *node_name);
 struct inode *nm_get_node_by_name(char *node_name);
-static void nm_do_callbacks(int type, void *ptr1, void *ptr2, u16 idx);
+static void nm_do_callbacks(int type, void *ptr1, void *ptr2, u8 idx);
 
 /* support for adding files, dirs, hardlinks in /proc/cluster/nm/... */
 extern struct file_operations simple_dir_operations;
@@ -176,11 +176,11 @@
 static ssize_t write_group(struct file *file, char *buf, size_t size);
 static ssize_t write_cluster(struct file *file, char *buf, size_t size);
 
-static struct inode * __nm_get_group_by_num(u16 group_num);
-static struct inode * __nm_get_node_by_num(u16 node_num);
+static struct inode * __nm_get_group_by_num(u8 group_num);
+static struct inode * __nm_get_node_by_num(u8 node_num);
 
 
-static u16 nm_get_group_index(struct inode *group, struct inode *inode, struct dentry **child);
+static u8 nm_get_group_index(struct inode *group, struct inode *inode, struct dentry **child);
 
 #define NM_HASH_BITS     7
 #define NM_HASH_SIZE     (1 << NM_HASH_BITS)
@@ -570,7 +570,7 @@
 	nm_group_inode_private *g = NULL;
 	int group_num, slot_num;
 	int ret = -EINVAL;
-	u16 ino;
+	u8 ino;
 	char tmpname[6];
 
 	nmprintk("add node to group...\n");
@@ -799,7 +799,7 @@
 	nm_network_iface *n;
 	struct inode *inode = NULL;
 	struct dentry *dentry;
-	u16 node_num;
+	u8 node_num;
 	u16 vers;
 
 	ret = -EINVAL;
@@ -840,7 +840,7 @@
 	int ret, tmpret;
 	nm_group_inode_private *g = NULL;
 	struct inode *inode = NULL;
-	u16 group_num;
+	u8 group_num;
 	struct dentry *dentry, *child;
 
 	ret = -EINVAL;
@@ -876,7 +876,7 @@
 {
 	nm_op *data;
 	int ret;
-	u16 me;
+	u8 me;
 	
 	nmprintk("write_cluster\n");
 
@@ -982,7 +982,7 @@
 
 
 
-static struct inode * __nm_get_group_by_num(u16 group_num)
+static struct inode * __nm_get_group_by_num(u8 group_num)
 {
 	struct inode *inode = iget(single_sb, group_num + NM_GROUP_INODE_START);
 	if (!inode)
@@ -994,7 +994,7 @@
 	return inode;
 }	
 
-static struct inode * __nm_get_node_by_num(u16 node_num)
+static struct inode * __nm_get_node_by_num(u8 node_num)
 {
 	struct inode *inode = iget(single_sb, node_num + NM_NODE_INODE_START);
 	if (!inode)
@@ -1030,7 +1030,7 @@
 }
 EXPORT_SYMBOL(nm_get_node_by_ip);
 
-struct inode * nm_get_group_by_num(u16 group_num)
+struct inode * nm_get_group_by_num(u8 group_num)
 {
 	struct inode *inode;
 	spin_lock(&nm_lock);
@@ -1045,7 +1045,7 @@
 	return &cluster;
 }
 
-struct inode * nm_get_node_by_num(u16 node_num)
+struct inode * nm_get_node_by_num(u8 node_num)
 {
 	struct inode *inode;
 	spin_lock(&nm_lock);
@@ -1055,7 +1055,7 @@
 }
 EXPORT_SYMBOL(nm_get_node_by_num);
 
-struct inode * nm_get_group_node_by_index(struct inode *group, u16 index)
+struct inode * nm_get_group_node_by_index(struct inode *group, u8 index)
 {
 	struct dentry *dentry = NULL, *parent;
 	struct inode *inode = NULL;
@@ -1123,11 +1123,11 @@
  * NOTE: currently getting the group index is slow
  *       will need to change this somehow
  */
-u16 nm_this_node(struct inode *group)
+u8 nm_this_node(struct inode *group)
 {
 	struct inode *inode = NULL;
 	struct dentry *child = NULL;
-	u16 node_num = NM_MAX_NODES;
+	u8 node_num = NM_MAX_NODES;
 
        	inode = nm_get_node_by_name(nm_nodename);
 	if (inode && inode->u.generic_ip) {
@@ -1145,11 +1145,11 @@
 EXPORT_SYMBOL(nm_this_node);
 
 /* slow */
-static u16 nm_get_group_index(struct inode *group, struct inode *inode, 
+static u8 nm_get_group_index(struct inode *group, struct inode *inode, 
 			      struct dentry **child)
 {
 	struct dentry *tmp = NULL, *parent = NULL;
-	u16 slot_num = NM_MAX_NODES;
+	u8 slot_num = NM_MAX_NODES;
 	struct list_head *iter;
 	char tmpname[6];
 	char *err;
@@ -1192,7 +1192,7 @@
 	return slot_num;
 }
 
-int nm_register_callback(int type, void (*func)(void *, void *, u16))
+int nm_register_callback(int type, void (*func)(void *, void *, u8))
 {
 	nm_callback_func *f;
 
@@ -1211,7 +1211,7 @@
 EXPORT_SYMBOL(nm_register_callback);
 
 #warning need to change nm callbacks to be like hb callbacks... no locks when calling.
-int nm_unregister_callback(int type, void (*func)(void *, void *, u16))
+int nm_unregister_callback(int type, void (*func)(void *, void *, u8))
 {
 	struct list_head *iter, *tmpiter;
 	int ret = -EINVAL;
@@ -1235,7 +1235,7 @@
 }
 EXPORT_SYMBOL(nm_unregister_callback);
 
-static void nm_do_callbacks(int type, void *ptr1, void *ptr2, u16 idx)
+static void nm_do_callbacks(int type, void *ptr1, void *ptr2, u8 idx)
 {
 	struct list_head *iter;
 	nm_callback_func *f;

Modified: trunk/fs/ocfs2/cluster/nodemanager.h
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.h	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/nodemanager.h	2005-01-26 07:55:49 UTC (rev 1855)
@@ -123,22 +123,22 @@
 	NM_NUM_CB
 };
 
-typedef void (nm_cb_func)(void *, void *, u16);
+typedef void (nm_cb_func)(void *, void *, u8);
 
 typedef struct _nm_callback_func
 {
 	struct list_head list;
 	nm_cb_func *func;
-	//void (*func)(void *, void *, u16);
+	//void (*func)(void *, void *, u8);
 } nm_callback_func;
 
 
 
 
-u16 nm_this_node(struct inode *group);
+u8 nm_this_node(struct inode *group);
 nm_cluster * nm_get_cluster(void);
-int nm_register_callback(int type, void (*func)(void *, void *, u16));
-int nm_unregister_callback(int type, void (*func)(void *, void *, u16));
+int nm_register_callback(int type, void (*func)(void *, void *, u8));
+int nm_unregister_callback(int type, void (*func)(void *, void *, u8));
 int nm_get_group_num_nodes(struct inode *group);
 int nm_make_group_ready(struct inode *group);
 void * nm_iterate_group_disk_slots(struct inode *group, int *idx);
@@ -149,11 +149,11 @@
 extern char *nm_nodename;
 
 
-struct inode * nm_get_group_by_num(u16 group_num);
-struct inode * nm_get_node_by_num(u16 node_num);
+struct inode * nm_get_group_by_num(u8 group_num);
+struct inode * nm_get_node_by_num(u8 node_num);
 struct inode * __nm_get_node_by_name(char *node_name, int dir);
 struct inode * nm_get_node_by_ip(u32 addr);
-struct inode * nm_get_group_node_by_index(struct inode *group, u16 index);
+struct inode * nm_get_group_node_by_index(struct inode *group, u8 index);
 
 static inline struct inode * nm_get_node_by_name(char *node_name)
 {

Modified: trunk/fs/ocfs2/cluster/ocfs2_heartbeat.h
===================================================================
--- trunk/fs/ocfs2/cluster/ocfs2_heartbeat.h	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/ocfs2_heartbeat.h	2005-01-26 07:55:49 UTC (rev 1855)
@@ -43,7 +43,8 @@
 	__u32 fd;
 	char disk_uuid[CLUSTER_DISK_UUID_LEN+1];
 	char pad1[15];  /* Pad to the __u16 following it */
-	__u16 group_num;
+	__u8  group_num;
+	__u8  pad2;
 	__u32 bits;
 	__u32 blocks;
 	__u64 start;

Modified: trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h
===================================================================
--- trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h	2005-01-26 07:55:49 UTC (rev 1855)
@@ -57,11 +57,12 @@
 
 typedef struct _nm_node_info 
 {
-	__u16 node_num;
-	__u16 pad1;
-	__u32 pad2;
+	__u8  node_num;
+	__u8  pad1;
+	__u16 pad2;
+	__u32 pad3;
 	char node_name[NM_MAX_NAME_LEN+1];
-	char pad3[63];
+	char pad4[63];
 	nm_network_iface ifaces[NM_MAX_IFACES];
 } nm_node_info;
 
@@ -83,9 +84,11 @@
 
 typedef struct _nm_group_change
 {
-	__u16 group_num;
-	__u16 node_num;
-	__u16 slot_num;
+	__u8 group_num;
+	__u8 node_num;
+	__u8 slot_num;
+	__u8 pad1;
+	__u32 pad2;
 	char disk_uuid[CLUSTER_DISK_UUID_LEN+1];
 	char name[NM_MAX_NAME_LEN+1];
 } nm_group_change;
@@ -96,7 +99,7 @@
 	__u16 opcode;
 	__u32 pad1;
 	union {
-		__u16 index;
+		__u8 index;
 		char name[NM_MAX_NAME_LEN+1];
 		nm_node_info node;
 		nm_group_change gc;

Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -148,7 +148,7 @@
 struct socket *recv_sock = NULL;
 static u16 ip_version, ip_port;
 static struct inode *net_inode = NULL;
-static u16 net_node_num;
+static u8 net_node_num;
 
 /* all this state should eventually be brought up by object activation
  * and tied to that object rather than being globally valid at insmod */

Modified: trunk/fs/ocfs2/cluster/tcp.h
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.h	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/cluster/tcp.h	2005-01-26 07:55:49 UTC (rev 1855)
@@ -194,19 +194,21 @@
 
 typedef struct _gsd_message
 {
-	u16 from;
+	u8 from;
 	u8 action;
 	u8 namelen;
+	u8 pad1;
+	u32 pad2;
 	u8 name[NM_MAX_NAME_LEN];
 } gsd_message;
 
 static inline void gsd_message_to_net(gsd_message *g)
 {
-	g->from = htons(g->from);
+	/* do nothing */
 }
 static inline void gsd_message_to_host(gsd_message *g)
 {
-	g->from = ntohs(g->from);
+	/* do nothing */
 }
 
 #endif /* CLUSTER_TCP_H */

Modified: trunk/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmaster.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/dlm/dlmmaster.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -328,7 +328,7 @@
 
 		spin_lock(&mle->spinlock);
 		if (mle->master != NM_MAX_NODES) {
-			u16 m = mle->master;
+			u8 m = mle->master;
 			// dlmprintk("node %u is the master!\n", m);
 			spin_unlock(&mle->spinlock);
 

Modified: trunk/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/dlm/dlmmod.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -71,7 +71,7 @@
 
 LIST_HEAD(dlm_domains);
 spinlock_t dlm_domain_lock = SPIN_LOCK_UNLOCKED;
-u16 dlm_global_index = NM_MAX_NODES;
+u8 dlm_global_index = NM_MAX_NODES;
 static spinlock_t dlm_cookie_lock = SPIN_LOCK_UNLOCKED;
 static u64 dlm_next_cookie = 1;
 
@@ -134,10 +134,9 @@
 
 
 /* fetch next node-local (u8 nodenum + u56 cookie) into u64 */
-static inline void dlm_get_next_cookie(u16 node_num, u64 *cookie)
+static inline void dlm_get_next_cookie(u8 node_num, u64 *cookie)
 {
-	/* why did I make node_num 16 bit to begin with? */
-	u64 tmpnode = (u8)(node_num & (u16)0x00ff);
+	u64 tmpnode = node_num;
 
 	/* shift single byte of node num into top 8 bits */
 	tmpnode <<= 56;

Modified: trunk/fs/ocfs2/dlm/dlmmod.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.h	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/dlm/dlmmod.h	2005-01-26 07:55:49 UTC (rev 1855)
@@ -177,9 +177,9 @@
 {
 	struct list_head resources;
 	struct list_head received;   // list of dlm_reco_lock_infos received from other nodes during recovery
-	u16 new_master;
-	u16 dead_node;
-	u16 sending_node;
+	u8  new_master;
+	u8  dead_node;
+	u8  sending_node;
 	u32 next_seq;
 	util_thread_info thread;
 	unsigned long node_map[BITS_TO_LONGS(NM_MAX_NODES)];
@@ -197,7 +197,7 @@
 	util_thread_info thread;
 	struct inode *group;
 	u32 key;
-	u16 group_index;
+	u8  group_index;
 	unsigned long node_map[BITS_TO_LONGS(NM_MAX_NODES)];
 	unsigned long recovery_map[BITS_TO_LONGS(NM_MAX_NODES)];
 	dlm_recovery_ctxt reco;
@@ -223,7 +223,7 @@
 	struct list_head recovering; // dlm_recovery_ctxt.resources list
 	spinlock_t spinlock;
 	wait_queue_head_t wq;
-	u16 owner;              // node which owns the lock resource, or unknown
+	u8  owner;              // node which owns the lock resource, or unknown
 	u16 state;
 	struct qstr lockname;
 	char lvb[DLM_LVB_LEN];
@@ -245,9 +245,7 @@
 	s8 type;
 	s8 convert_type;
 	s8 highest_blocked;
-	s8 reserved1;
-	u16 node;
-	u16 reserved2;
+	u8 node;
 
 	dlm_astlockfunc_t *ast;     // ast and bast must be callable while holding a spinlock!
 	dlm_bastlockfunc_t *bast;
@@ -267,7 +265,7 @@
 #define DLM_LKSB_UNUSED6           0x80
 
 struct _dlm_lockstatus {
-	dlm_status status;  // can we just change this to a u8 or u16?
+	dlm_status status;
 	u32 flags;           
 	dlm_lock *lockid;
 	char lvb[DLM_LVB_LEN];
@@ -297,7 +295,7 @@
 	unsigned long vote_map[BITS_TO_LONGS(NM_MAX_NODES)];
 	unsigned long response_map[BITS_TO_LONGS(NM_MAX_NODES)];
 	unsigned long node_map[BITS_TO_LONGS(NM_MAX_NODES)];
-	u16 master;
+	u8 master;
 	u8 error;
 	u8 type;    // BLOCK or MASTER
 	union {
@@ -322,7 +320,7 @@
 typedef struct _dlm_reco_node_data
 {
 	int state;
-	u16 node_num;
+	u8 node_num;
 	struct list_head list;
 	struct list_head granted;
 	struct list_head converting;
@@ -350,46 +348,60 @@
 
 typedef struct _dlm_master_request
 {
-	u16 node_idx;
+	u8 node_idx;
 	u8 namelen;
-	u8 pad1;
+	u16 pad1;
+	u32 pad2;
+
 	u8 name[NM_MAX_NAME_LEN];
 } dlm_master_request;
 
 typedef struct _dlm_master_request_resp
 {
-	u16 node_idx;
+	u8 node_idx;
 	u8 response;
 	u8 namelen;
+	u8 pad1;
+	u32 pad2;
+
 	u8 name[NM_MAX_NAME_LEN];
 } dlm_master_request_resp;
 
 typedef struct _dlm_assert_master
 {
-	u16 node_idx;
+	u8 node_idx;
 	u8 namelen;
-	u8 pad1;
+	u16 pad1;
+	u32 pad2;
+
 	u8 name[NM_MAX_NAME_LEN];
 } dlm_assert_master;
 
 typedef struct _dlm_create_lock
 {
 	u64 cookie;
+
 	u32 flags;
-	u16 node_idx;
+	u8 pad1;
+	u8 node_idx;
 	s8 requested_type;
 	u8 namelen;
+
 	u8 name[NM_MAX_NAME_LEN];
 } dlm_create_lock;
 
 typedef struct _dlm_convert_lock
 {
 	u64 cookie;
+
 	u32 flags;
-	u16 node_idx;
+	u8 pad1;
+	u8 node_idx;
 	s8 requested_type;
 	u8 namelen;
+
 	u8 name[NM_MAX_NAME_LEN];
+
 	s8 lvb[0];
 } dlm_convert_lock;
 #define DLM_CONVERT_LOCK_MAX_LEN  (sizeof(dlm_convert_lock) + DLM_LVB_LEN)
@@ -397,11 +409,14 @@
 typedef struct _dlm_unlock_lock
 {
 	u64 cookie;
+
 	u32 flags;
-	u16 node_idx;
+	u16 pad1;
+	u8 node_idx;
 	u8 namelen;
-	u8 pad1;
+
 	u8 name[NM_MAX_NAME_LEN];
+
 	s8 lvb[0];
 } dlm_unlock_lock;
 #define DLM_UNLOCK_LOCK_MAX_LEN  (sizeof(dlm_unlock_lock) + DLM_LVB_LEN)
@@ -409,14 +424,15 @@
 typedef struct _dlm_proxy_ast
 {
 	u64 cookie;
+
 	u32 flags;
-	u16 node_idx;
-	u16 pad1;
+	u8 node_idx;
 	u8 type;
 	u8 blocked_type;
 	u8 namelen;
-	u8 pad2;
+
 	u8 name[NM_MAX_NAME_LEN];
+
 	s8 lvb[0];
 } dlm_proxy_ast;
 #define DLM_PROXY_AST_MAX_LEN  (sizeof(dlm_proxy_ast) + DLM_LVB_LEN)
@@ -424,81 +440,73 @@
 
 static inline void dlm_master_request_to_net(dlm_master_request *m)
 {
-	m->node_idx = htons(m->node_idx);
+	/* do nothing */
 }
 static inline void dlm_master_request_to_host(dlm_master_request *m)
 {
-	m->node_idx = ntohs(m->node_idx);
+	/* do nothing */
 }
 
 static inline void dlm_master_request_resp_to_net(dlm_master_request_resp *m)
 {
-	m->node_idx = htons(m->node_idx);
+	/* do nothing */
 }
 static inline void dlm_master_request_resp_to_host(dlm_master_request_resp *m)
 {
-	m->node_idx = ntohs(m->node_idx);
+	/* do nothing */
 }
 
 static inline void dlm_assert_master_to_net(dlm_assert_master *m)
 {
-	m->node_idx = htons(m->node_idx);
+	/* do nothing */
 }
 static inline void dlm_assert_master_to_host(dlm_assert_master *m)
 {
-	m->node_idx = ntohs(m->node_idx);
+	/* do nothing */
 }
 
 static inline void dlm_create_lock_to_net(dlm_create_lock *c)
 {
 	c->cookie = cpu_to_be64(c->cookie);
 	c->flags = htonl(c->flags);
-	c->node_idx = htons(c->node_idx);
 }
 static inline void dlm_create_lock_to_host(dlm_create_lock *c)
 {
 	c->cookie = be64_to_cpu(c->cookie);
 	c->flags = ntohl(c->flags);
-	c->node_idx = ntohs(c->node_idx);
 }
 
 static inline void dlm_convert_lock_to_net(dlm_convert_lock *c)
 {
 	c->cookie = cpu_to_be64(c->cookie);
 	c->flags = htonl(c->flags);
-	c->node_idx = htons(c->node_idx);
 }
 static inline void dlm_convert_lock_to_host(dlm_convert_lock *c)
 {
 	c->cookie = be64_to_cpu(c->cookie);
 	c->flags = ntohl(c->flags);
-	c->node_idx = ntohs(c->node_idx);
 }
 
 static inline void dlm_unlock_lock_to_net(dlm_unlock_lock *u)
 {
 	u->cookie = cpu_to_be64(u->cookie);
 	u->flags = htonl(u->flags);
-	u->node_idx = htons(u->node_idx);
 }
 static inline void dlm_unlock_lock_to_host(dlm_unlock_lock *u)
 {
 	u->cookie = be64_to_cpu(u->cookie);
 	u->flags = ntohl(u->flags);
-	u->node_idx = ntohs(u->node_idx);
 }
 
 static inline void dlm_proxy_ast_to_net(dlm_proxy_ast *a)
 {
 	a->cookie = cpu_to_be64(a->cookie);
 	a->flags = htonl(a->flags);
-	a->node_idx = htons(a->node_idx);
 }
 static inline void dlm_proxy_ast_to_host(dlm_proxy_ast *a)
 {
 	a->cookie = be64_to_cpu(a->cookie);
 	a->flags = ntohl(a->flags);
-	a->node_idx = ntohs(a->node_idx);
 }
 
 
@@ -557,7 +565,7 @@
 int dlm_refresh_lock_resource(dlm_ctxt *dlm, dlm_lock_resource *res);
 int dlm_do_ast(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock);
 int dlm_do_bast(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int blocked_type);
-u16 dlm_nm_this_node(dlm_ctxt *dlm);
+u8 dlm_nm_this_node(dlm_ctxt *dlm);
 void dlm_kick_thread(dlm_ctxt *dlm, dlm_lock_resource *res);
 
 int dlm_nm_init(dlm_ctxt *dlm);

Modified: trunk/fs/ocfs2/dlm/dlmrecovery.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmrecovery.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/dlm/dlmrecovery.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -49,18 +49,18 @@
 #include "dlmcommon.h"
 #include "dlmmod.h"
 
-static void dlm_do_local_recovery_cleanup(dlm_ctxt *dlm, u16 dead_node, int locked);
+static void dlm_do_local_recovery_cleanup(dlm_ctxt *dlm, u8 dead_node, int locked);
 
 int dlm_recovery_thread(void *data);
 void dlm_complete_recovery_thread(dlm_ctxt *dlm);
 int dlm_launch_recovery_thread(dlm_ctxt *dlm);
 void dlm_kick_recovery_thread(dlm_ctxt *dlm);
 			
-u16 dlm_pick_recovery_master(dlm_ctxt *dlm, u16 *new_dead_node);
+u8 dlm_pick_recovery_master(dlm_ctxt *dlm, u8 *new_dead_node);
 static int dlm_remaster_locks_local(dlm_ctxt *dlm);
 int dlm_init_recovery_area(dlm_ctxt *dlm);
-int dlm_request_all_locks(dlm_ctxt *dlm, u16 request_from, u16 dead_node);
-void dlm_destroy_recovery_area(dlm_ctxt *dlm, u16 dead_node);
+int dlm_request_all_locks(dlm_ctxt *dlm, u8 request_from, u8 dead_node);
+void dlm_destroy_recovery_area(dlm_ctxt *dlm, u8 dead_node);
 
 #define DLM_RECOVERY_THREAD_MS  2000
 
@@ -137,7 +137,7 @@
 	dlm_lock_resource *res;
 	char name[12];
 	dlm_ctxt *dlm = data;
-	u16 tmp;
+	u8 tmp;
 
 
 	dlm_num = nm_get_group_global_index(dlm->group);
@@ -182,7 +182,7 @@
 
 		/* choose a new master */
 		if (dlm->reco.new_master == NM_INVALID_SLOT_NUM) {
-			u16 new_dead_node = dlm->reco.dead_node;
+			u8 new_dead_node = dlm->reco.dead_node;
 			dlm->reco.new_master = dlm_pick_recovery_master(dlm, &new_dead_node);
 			if (new_dead_node != dlm->reco.dead_node) {
 				// master wants to recover a different node
@@ -435,7 +435,7 @@
 	return 0;
 }
 
-void dlm_destroy_recovery_area(dlm_ctxt *dlm, u16 dead_node)
+void dlm_destroy_recovery_area(dlm_ctxt *dlm, u8 dead_node)
 {
 	struct list_head *iter, *iter2;
 	dlm_reco_node_data *ndata;
@@ -452,7 +452,7 @@
 	}
 }
 
-int dlm_request_all_locks(dlm_ctxt *dlm, u16 request_from, u16 dead_node)
+int dlm_request_all_locks(dlm_ctxt *dlm, u8 request_from, u8 dead_node)
 {
 	dlmprintk("dlm_request_all_locks: dead node is %u, sending request to %u\n",
 	       dead_node, request_from);
@@ -463,7 +463,7 @@
 
 typedef struct _dlm_reco_request_locks
 {
-	u16 dead_node;
+	u8 dead_node;
 } dlm_reco_request_locks;
 
 typedef struct _dlm_reco_node_data
@@ -563,8 +563,8 @@
 
 typedef struct _dlm_reco_lock_info
 {
-	u16 node;
-	u16 unused1;
+	u8 node;
+	u8 unused1;
 	u64 cookie;
 	s8 type;
 	s8 convert_type;
@@ -593,7 +593,7 @@
 {
 	u8 request_type;
 	u8 num_locks;
-	u16 dead_node;
+	u8 dead_node;
 	u32 seqnum;
 	dlm_reco_lock_info lock[DLM_LOCKS_PER_PACKET];
 } dlm_reco_lock_arr_req;
@@ -602,7 +602,7 @@
 {
 	u8 request_type;
 	u8 unused1;
-	u16 dead_node;
+	u8 dead_node;
 	u32 num;
 } dlm_reco_request;
 
@@ -753,7 +753,7 @@
 
 
 
-static int dlm_send_reco_request(dlm_ctxt *dlm, dlm_reco_request *buf, u16 to, struct inode *node)
+static int dlm_send_reco_request(dlm_ctxt *dlm, dlm_reco_request *buf, u8 to, struct inode *node)
 {
 	int ret;
 	net_msg *msg = net_package_message(DLM_NET_RECOVERY_REQUEST_MSG_TYPE, 
@@ -777,7 +777,7 @@
 #endif  /* LOUSY_RECOVERY */
 
 #warning may need to change kfree to put_lock and refcounting here
-static void dlm_do_local_recovery_cleanup(dlm_ctxt *dlm, u16 dead_node, int locked)
+static void dlm_do_local_recovery_cleanup(dlm_ctxt *dlm, u8 dead_node, int locked)
 {
 	struct list_head *iter, *iter2, *tmpiter;
 	dlm_lock_resource *res;
@@ -908,9 +908,9 @@
 	return ret;
 }
 
-u16 dlm_pick_recovery_master(dlm_ctxt *dlm, u16 *new_dead_node)
+u8 dlm_pick_recovery_master(dlm_ctxt *dlm, u8 *new_dead_node)
 {
-	u16 master = 0;
+	u8 master = 0;
 #if 0
 	dlm_status ret;
 	dlm_lockstatus lksb;

Modified: trunk/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmthread.c	2005-01-26 02:20:27 UTC (rev 1854)
+++ trunk/fs/ocfs2/dlm/dlmthread.c	2005-01-26 07:55:49 UTC (rev 1855)
@@ -53,7 +53,7 @@
 
 extern spinlock_t dlm_domain_lock;
 extern struct list_head dlm_domains;
-extern u16 dlm_global_index;
+extern u8 dlm_global_index;
 
 static int dlm_thread(void *data);
 



More information about the Ocfs2-commits mailing list