[Ocfs2-tools-commits] smushran commits r880 - in trunk: libocfs2 mounted.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri May 6 15:30:03 CDT 2005


Author: smushran
Date: 2005-05-06 15:30:01 -0500 (Fri, 06 May 2005)
New Revision: 880

Modified:
   trunk/libocfs2/checkhb.c
   trunk/mounted.ocfs2/mounted.c
Log:
trivial mounted.ocfs2 fix

Modified: trunk/libocfs2/checkhb.c
===================================================================
--- trunk/libocfs2/checkhb.c	2005-05-05 23:53:15 UTC (rev 879)
+++ trunk/libocfs2/checkhb.c	2005-05-06 20:30:01 UTC (rev 880)
@@ -89,7 +89,6 @@
 {
 	ocfs2_filesys *fs = NULL;
 	errcode_t ret = 0;
-	uint16_t num_nodes;
 	struct list_head *pos;
 	ocfs2_devices *dev = NULL;
 	char *device= NULL;
@@ -113,18 +112,19 @@
 			goto bail;
 
 		/* get label/uuid for ocfs2 */
-		num_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+		dev->max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
 		memcpy(dev->label, OCFS2_RAW_SB(fs->fs_super)->s_label,
 		       sizeof(dev->label));
 		memcpy(dev->uuid, OCFS2_RAW_SB(fs->fs_super)->s_uuid,
 		       sizeof(dev->uuid));
 
-		ret = ocfs2_malloc((sizeof(uint8_t) * num_nodes), &dev->node_nums);
+		ret = ocfs2_malloc((sizeof(uint8_t) * dev->max_nodes),
+				   &dev->node_nums);
 		if (ret)
 			goto bail;
 
 		memset(dev->node_nums, OCFS2_MAX_NODES,
-		       (sizeof(uint8_t) * num_nodes));
+		       (sizeof(uint8_t) * dev->max_nodes));
 
 		/* read slotmap to get nodes on which the volume is mounted */
 		ret = ocfs2_read_slotmap(fs, dev->node_nums);

Modified: trunk/mounted.ocfs2/mounted.c
===================================================================
--- trunk/mounted.ocfs2/mounted.c	2005-05-05 23:53:15 UTC (rev 879)
+++ trunk/mounted.ocfs2/mounted.c	2005-05-06 20:30:01 UTC (rev 880)
@@ -50,12 +50,13 @@
 "	-d quick detect\n"
 "	-f full detect\n";
 
-static void ocfs2_print_nodes(uint8_t *nums, char **names)
+static void ocfs2_print_nodes(ocfs2_devices *dev, char **names)
 {
-	int i = 0;
+	int i;
 	uint8_t n;
+	uint8_t *nums = dev->node_nums;
 
-	while (nums[i] != OCFS2_MAX_NODES) {
+	for (i = 0; i < dev->max_nodes && nums[i] != OCFS2_MAX_NODES; ++i) {
 		if (i)
 			printf(", ");
 		n = nums[i];
@@ -63,10 +64,7 @@
 			printf("%s", names[n]);
 		else
 			printf("%d", n);
-		++i;
 	}
-
-	return ;
 }
 
 
@@ -115,7 +113,7 @@
 				printf("Not mounted\n");
 				continue;
 			}
-			ocfs2_print_nodes(dev->node_nums, nodes);
+			ocfs2_print_nodes(dev, nodes);
 			printf("\n");
 		}
 	}
@@ -125,8 +123,6 @@
 
 	if (cluster_names)
 		o2cb_free_cluster_list(cluster_names);
-
-	return ;
 }
 
 
@@ -148,8 +144,6 @@
 		       (dev->fs_type == 2 ? "ocfs2" : "ocfs"), uuid,
 		       dev->label);
 	}
-
-	return ;
 }
 
 static errcode_t ocfs2_partition_list (struct list_head *dev_list)
@@ -189,7 +183,6 @@
 static void usage(char *progname)
 {
 	printf(usage_string, progname);
-	return ;
 }
 
 



More information about the Ocfs2-tools-commits mailing list