[Ocfs2-commits] khackel commits r1787 - trunk/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Jan 18 14:47:47 CST 2005


Author: khackel
Date: 2005-01-18 14:47:45 -0600 (Tue, 18 Jan 2005)
New Revision: 1787

Modified:
   trunk/cluster/heartbeat.c
Log:
put to 80 column

Modified: trunk/cluster/heartbeat.c
===================================================================
--- trunk/cluster/heartbeat.c	2005-01-18 20:40:55 UTC (rev 1786)
+++ trunk/cluster/heartbeat.c	2005-01-18 20:47:45 UTC (rev 1787)
@@ -84,7 +84,8 @@
 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 int hb_init_disk_hb_group(struct inode *group, dev_t dev, u32 bits, u32 blocks, u64 start);
+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);
 static void hb_do_callbacks(int type, void *ptr1, void *ptr2, int idx);
 static void hb_end_buffer_io_sync(struct buffer_head *bh, int uptodate);
@@ -142,7 +143,8 @@
 static int hb_do_node_down(struct inode *group, struct inode *node, int idx)
 {
 	//int ret;
-	hbprintk("hb_do_node_down: group=%lu, node=%lu\n", group->i_ino, node->i_ino);
+	hbprintk("hb_do_node_down: group=%lu, node=%lu\n", group->i_ino, 
+		 node->i_ino);
 	hbprintk("NOT removing node from group\n");
 	//ret = nm_remove_node_from_group(group, node);
 	hb_do_callbacks(HB_NODE_DOWN_CB, group, node, idx);
@@ -151,7 +153,8 @@
 
 static int hb_do_node_up(struct inode *group, struct inode *node, int idx)
 {
-	hbprintk("hb_do_node_up: group=%lu, node=%lu\n", group->i_ino, node->i_ino);
+	hbprintk("hb_do_node_up: group=%lu, node=%lu\n", group->i_ino, 
+		 node->i_ino);
 	hb_do_callbacks(HB_NODE_UP_CB, group, node, idx);
 	return 0;
 }
@@ -281,7 +284,7 @@
 			
 			if (ino == nm_this_node(group)) {
 				memset(bh->b_data, 0, bh->b_size);
-				hb_block = (hb_disk_heartbeat_block *)bh->b_data;
+				hb_block= (hb_disk_heartbeat_block *)bh->b_data;
 				BUG_ON(bh->b_size < sizeof(*hb_block));
 
 				/* TODO: time stuff */
@@ -335,10 +338,12 @@
 				node->i_atime = mk_inode_time(cputime, 0);
 				slot->last_time = cputime;
 				slot->margin = HB_DISK_MARGIN;
-				hb_do_callbacks(HB_NODE_RESPONDED_CB, group, node, idx);
+				hb_do_callbacks(HB_NODE_RESPONDED_CB, 
+						group, node, idx);
 			} else {
 				slot->margin--;
-				hbprintk("node %d missed.  margin=%d\n", ino, slot->margin);
+				hbprintk("node %d missed.  margin=%d\n", 
+					 ino, slot->margin);
 			}
 
 			if (ino != nm_this_node(group) && slot->margin <= 0) {
@@ -394,7 +399,8 @@
 			if (atomic_read(&hb_thread_woken))
 				hbprintk("aha!!! hb thread woken!\n");
 			else 
-				hbprintk("hb thread timed out waiting, running again\n");
+				hbprintk("hb thread timed out waiting, "
+					 "running again\n");
 #endif
 			continue;
 		}
@@ -423,7 +429,8 @@
 	init_completion (&hb_complete);
 
 	hbprintk("starting hb thread...\n");
-	hb_pid = kernel_thread (hb_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+	hb_pid = kernel_thread (hb_thread, NULL, 
+				CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
 	if (hb_pid < 0) {
 		hbprintk("unable to launch hb thread, error=%d", hb_pid);
 		return -EINVAL;
@@ -447,7 +454,8 @@
 
 
 
-static int hb_init_disk_hb_group(struct inode *group, dev_t dev, u32 bits, u32 blocks, u64 start)
+static int hb_init_disk_hb_group(struct inode *group, dev_t dev, u32 bits, 
+				 u32 blocks, u64 start)
 {
 	int ret = -EINVAL;
 	cluster_disk *disk;
@@ -504,17 +512,21 @@
 	{
 		case HB_OP_START_DISK_HEARTBEAT:
 			if (data->bits < 9 || data->bits > 12) {
-				ret = sprintf(buf, "%d: bad blocksize bits! %u", -EINVAL, data->bits);
+				ret = sprintf(buf, "%d: bad blocksize bits! %u",
+					      -EINVAL, data->bits);
 				break;
 			}
 			group = nm_get_group_by_num(data->group_num);
 			if (!group || !group->u.generic_ip) {
-				ret = sprintf(buf, "%d: bad group number! %u", -EINVAL, data->group_num);
+				ret = sprintf(buf, "%d: bad group number! %u", 
+					      -EINVAL, data->group_num);
 				break;
 			}
 			priv = group->u.generic_ip;
-			if (strncmp(priv->disk.uuid, data->disk_uuid, CLUSTER_DISK_UUID_LEN) != 0) {
-				ret = sprintf(buf, "%d: bad disk uuid!", -EINVAL);
+			if (strncmp(priv->disk.uuid, data->disk_uuid, 
+				    CLUSTER_DISK_UUID_LEN) != 0) {
+				ret = sprintf(buf, "%d: bad disk uuid!", 
+					      -EINVAL);
 				break;
 			}
 			filp = fget(data->fd);
@@ -523,36 +535,43 @@
 				break;
 			}
 			dev = filp->f_dentry->d_inode->i_rdev;
-			tmpret = hb_init_disk_hb_group(group, dev, data->bits, data->blocks, data->start);
+			tmpret = hb_init_disk_hb_group(group, dev, data->bits, 
+						       data->blocks, 
+						       data->start);
 			if (tmpret < 0) {
 				fput(filp);
-				ret = sprintf(buf, "%d: failed to init disk heartbeat for group %u!", 
+				ret = sprintf(buf, "%d: failed to init disk "
+					      "heartbeat for group %u!", 
 					      -EINVAL, data->group_num);
 			} else {
-				ret = sprintf(buf, "0: disk heartbeat started for group %u!", 
-					      data->group_num);
+				ret = sprintf(buf, "0: disk heartbeat started "
+					      "for group %u!", data->group_num);
 			}
 			break;
 
 		case HB_OP_GET_NODE_MAP:
 			group = nm_get_group_by_num(data->group_num);
 			if (!group || !group->u.generic_ip) {
-				ret = sprintf(buf, "%d: bad group number! %u", -EINVAL, data->group_num);
+				ret = sprintf(buf, "%d: bad group number! %u", 
+					      -EINVAL, data->group_num);
 				break;
 			}
 			
-			if ((ret = hb_fill_node_map(group, tmpmap, sizeof(tmpmap))) == 0) {
+			if ((ret = hb_fill_node_map(group, tmpmap, 
+						    sizeof(tmpmap))) == 0) {
 				ret = sprintf(buf, "0: ");
 				buf += ret;
 				memcpy(buf, tmpmap, sizeof(tmpmap));
 				ret += sizeof(tmpmap);
 			} else {
-				ret = sprintf(buf, "%d: error occurred in hb_fill_node_map", ret);
+				ret = sprintf(buf, "%d: error occurred in "
+					      "hb_fill_node_map", ret);
 			}
 			break;
 
 		default:
-			ret = sprintf(buf, "%d: bad opcode! %u", -EINVAL, data->opcode);
+			ret = sprintf(buf, "%d: bad opcode! %u", -EINVAL, 
+				      data->opcode);
 			break;
 	}
 
@@ -578,7 +597,8 @@
 		/* last one */ {""}
 	};
 	
-	ops = kmalloc(sizeof(TA_write_ops) + (1 * sizeof(TA_write_op *)), GFP_KERNEL);
+	ops = kmalloc(sizeof(TA_write_ops) + (1 * sizeof(TA_write_op *)), 
+		      GFP_KERNEL);
 	if (!ops)
 		return -ENOMEM;
 
@@ -646,20 +666,23 @@
 	if (disk->uuid[0]) {
 		ret = util_resize_rarray(&disk->slots, idx+1);
 		if (ret < 0) {
-			hbprintk("eeeeeeek!!!! failed to resize disk state data\n");
+			hbprintk("eeeeeeek!!!! failed to resize disk state "
+				 "data\n");
 			goto leave;
 		}
 	
 		ino = nm_get_node_global_index(node);
 		if (ino > disk->num_blocks) {
-			hbprintk("disk heartbeat area does not have enough blocks!\n");
+			hbprintk("disk heartbeat area does not have enough "
+				 "blocks!\n");
 			goto leave;
 		}
 		block = ino + disk->start_block;
 	
 		slot = util_rarray_idx_to_slot(&disk->slots, idx);
 		if (!slot) {
-			hbprintk("eeeeeeek!!!! failed to get disk state data pointer: %d\n", idx);
+			hbprintk("eeeeeeek!!!! failed to get disk state data "
+				 "pointer: %d\n", idx);
 			goto leave;
 		}
 		slot->inode = igrab(node);
@@ -669,7 +692,8 @@
 		slot->bh = hb_getblk(block, disk);
 		slot->state = HB_NODE_STATE_INIT;
 	} else {
-		hbprintk("doing nothing for group add for non-disk heartbeat group\n");
+		hbprintk("doing nothing for group add for non-disk heartbeat "
+			 "group\n");
 	}
 	
 leave:
@@ -698,7 +722,8 @@
 	disk = &priv->disk;
 	slot = util_rarray_idx_to_slot(&disk->slots, idx);
 	if (!slot) {
-		hbprintk("eeeeeeek!!!! failed to get disk state data pointer: %d\n", idx);
+		hbprintk("eeeeeeek!!!! failed to get disk state data "
+			 "pointer: %d\n", idx);
 		goto leave;
 	}
 	if (slot->inode!=node) {
@@ -741,7 +766,8 @@
 	spin_lock(&hb_lock);
 	list_add_tail(&priv->net_list, &hb_net_groups);
 	if (priv->disk.uuid[0]) {
-		hbprintk("adding priv=%p inode=%p to disk group list\n", priv, group);
+		hbprintk("adding priv=%p inode=%p to disk group list\n", 
+			 priv, group);
 		list_add_tail(&priv->disk_list, &hb_disk_groups);
 	}
 	spin_unlock(&hb_lock);
@@ -757,7 +783,8 @@
 	while (hb_callback_state[type] == HB_CB_STATE_FROZEN) {
 		spin_unlock(&hb_cb_lock);
 		atomic_set(&hb_cb_ready, 0);
-		if (util_wait_atomic_eq(&hb_cb_wq, &hb_cb_ready, 1, 0) == -EINTR) {
+		if (util_wait_atomic_eq(&hb_cb_wq, &hb_cb_ready, 1, 0) == 
+		    -EINTR) {
 			return -EINTR;
 		}
 		spin_lock(&hb_cb_lock);
@@ -849,8 +876,8 @@
 	if (priv->disk.uuid[0]) {
 		while ((slot = nm_iterate_group_disk_slots(group, &idx))) {
 			if (idx >= size-1) {
-				hbprintk("map size (%d) too small for idx (%d)\n",
-			       	size, idx);
+				hbprintk("map size (%d) too small for "
+					 "index (%d)\n", size, idx);
 				up(&group->i_sem);
 				return -EINVAL;
 			}
@@ -859,7 +886,8 @@
 			idx++;
 		}
 	} else {
-		hbprintk("filling straight from slot bitmap for non-disk heartbeat group\n");
+		hbprintk("filling straight from slot bitmap for non-disk "
+			 "heartbeat group\n");
 		memcpy(map, priv->slot_bitmap, size);
 	}
 



More information about the Ocfs2-commits mailing list