[Ocfs2-tools-devel] [PATCH 1/7] mounted.ocfs2: Display uuid in all caps

Sunil Mushran sunil.mushran at oracle.com
Fri Mar 5 11:59:51 PST 2010


The tool was displaying the uuid in the 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb
format. This patch makes it display in the all caps format.
1B4E28BA2FA111D2883FB9A761BDE3FB. This is useful because we use this format
when creating the names for the heartbeat region and the dlm domain.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 mounted.ocfs2/mounted.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/mounted.ocfs2/mounted.c b/mounted.ocfs2/mounted.c
index f1c7ddf..d610ece 100644
--- a/mounted.ocfs2/mounted.c
+++ b/mounted.ocfs2/mounted.c
@@ -141,17 +141,22 @@ static void ocfs2_print_quick_detect(struct list_head *dev_list)
 {
 	ocfs2_devices *dev;
 	struct list_head *pos;
-	char uuid[40];
+	char uuid[OCFS2_VOL_UUID_LEN * 2 + 1];
+	int i;
+	char *p;
 
-	printf("%-20s  %-5s  %-36s  %-s\n", "Device", "FS", "UUID", "Label");
+	printf("%-20s  %-5s  %-32s  %-s\n", "Device", "FS", "UUID", "Label");
 	list_for_each(pos, dev_list) {
 		dev = list_entry(pos, ocfs2_devices, list);
 		if (dev->fs_type == 0)
 			continue;
 
-		uuid_unparse(dev->uuid, uuid);
+		for (i = 0, p = uuid; i < OCFS2_VOL_UUID_LEN; i++) {
+			snprintf(p, 3, "%02X", dev->uuid[i]);
+			p += 2;
+		}
 
-		printf("%-20s  %-5s  %-36s  %-s\n", dev->dev_name,
+		printf("%-20s  %-5s  %-32s  %-s\n", dev->dev_name,
 		       (dev->fs_type == 2 ? "ocfs2" : "ocfs"), uuid,
 		       dev->label);
 	}
-- 
1.6.3.3




More information about the Ocfs2-tools-devel mailing list