[Ocfs2-tools-commits] smushran commits r324 - trunk/debugfs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Oct 11 14:00:20 CDT 2004


Author: smushran
Date: 2004-10-11 14:00:18 -0500 (Mon, 11 Oct 2004)
New Revision: 324

Modified:
   trunk/debugfs.ocfs2/dump.c
Log:
llu ==> PRIu64 in debugfs.ocfs2/dump.c

Modified: trunk/debugfs.ocfs2/dump.c
===================================================================
--- trunk/debugfs.ocfs2/dump.c	2004-10-07 23:51:47 UTC (rev 323)
+++ trunk/debugfs.ocfs2/dump.c	2004-10-11 19:00:18 UTC (rev 324)
@@ -51,9 +51,9 @@
 	       sb->s_feature_compat, sb->s_feature_incompat,
 	       sb->s_feature_ro_compat);
 
-	fprintf(out, "\tRoot Blknum: %llu   System Dir Blknum: %llu\n",
-		(unsigned long long)sb->s_root_blkno,
-		(unsigned long long)sb->s_system_dir_blkno);
+	fprintf(out, "\tRoot Blknum: %"PRIu64"   System Dir Blknum: %"PRIu64"\n",
+		sb->s_root_blkno,
+		sb->s_system_dir_blkno);
 
 	fprintf(out, "\tBlock Size Bits: %u   Cluster Size Bits: %u\n",
 	       sb->s_blocksize_bits, sb->s_clustersize_bits);
@@ -139,32 +139,32 @@
 	if (in->i_flags & OCFS2_CHAIN_FL)
 		g_string_append (flags, "chain ");
 
-	fprintf(out, "\tInode: %llu   Mode: 0%0o   Generation: %u\n",
-	        (unsigned long long)in->i_blkno, mode, in->i_generation);
+	fprintf(out, "\tInode: %"PRIu64"   Mode: 0%0o   Generation: %u\n",
+	        in->i_blkno, mode, in->i_generation);
 
 	fprintf(out, "\tType: %s   Flags: %s\n", str, flags->str);
 
 	pw = getpwuid(in->i_uid);
 	gr = getgrgid(in->i_gid);
-	fprintf(out, "\tUser: %d (%s)   Group: %d (%s)   Size: %llu\n",
+	fprintf(out, "\tUser: %d (%s)   Group: %d (%s)   Size: %"PRIu64"\n",
 	       in->i_uid, (pw ? pw->pw_name : "unknown"),
 	       in->i_gid, (gr ? gr->gr_name : "unknown"),
-	       (unsigned long long)in->i_size);
+	       in->i_size);
 
 	fprintf(out, "\tLinks: %u   Clusters: %u\n", in->i_links_count, in->i_clusters);
 
 	dump_disk_lock (out, &(in->i_disk_lock));
 
 	str = ctime((time_t*)&in->i_ctime);
-	fprintf(out, "\tctime: 0x%llx -- %s", (unsigned long long)in->i_ctime, str);
+	fprintf(out, "\tctime: 0x%"PRIx64" -- %s", in->i_ctime, str);
 	str = ctime((time_t*)&in->i_atime);
-	fprintf(out, "\tatime: 0x%llx -- %s", (unsigned long long)in->i_atime, str);
+	fprintf(out, "\tatime: 0x%"PRIx64" -- %s", in->i_atime, str);
 	str = ctime((time_t*)&in->i_mtime);
-	fprintf(out, "\tmtime: 0x%llx -- %s", (unsigned long long)in->i_mtime, str);
+	fprintf(out, "\tmtime: 0x%"PRIx64" -- %s", in->i_mtime, str);
 	str = ctime((time_t*)&in->i_dtime);
-	fprintf(out, "\tdtime: 0x%llx -- %s", (unsigned long long)in->i_dtime, str);
+	fprintf(out, "\tdtime: 0x%"PRIx64" -- %s", in->i_dtime, str);
 
-	fprintf(out, "\tLast Extblk: %llu\n", (unsigned long long)in->i_last_eb_blk);
+	fprintf(out, "\tLast Extblk: %"PRIu64"\n", in->i_last_eb_blk);
 	fprintf(out, "\tSub Alloc Node: %u   Sub Alloc Bit: %u\n",
 	       in->i_suballoc_node, in->i_suballoc_bit);
 
@@ -184,33 +184,9 @@
  */
 void dump_disk_lock (FILE *out, ocfs2_disk_lock *dl)
 {
-#if 0
-	ocfs2_super_block *sb = &((gbls.superblk)->id2.i_super);
-	int i, j, k;
-	__u32 node_map;
-#endif
-
 	fprintf(out, "\tLock Master: %u   Level: 0x%0x\n",
 		dl->dl_master, dl->dl_level);
 
-#if 0
-	fprintf(out, "\tLock Master: %u   Level: 0x%0x   Seqnum: %llu\n",
-	       dl->dl_master, dl->dl_level, (unsigned long long)dl->dl_seq_num);
-
-	fprintf(out, "\tLock Map: ");
-	for (i = 0, j = 0; i < 8 && j < sb->s_max_nodes; ++i) {
-		if (i)
-			fprintf(out, "               ");
-		node_map = dl->dl_node_map[i];
-		for (k = 0; k < 32 && j < sb->s_max_nodes; k++, j++) {
-			fprintf (out, "%d", ((node_map & (1 << k)) ? 1 : 0));
-			if (!((k + 1) % 8))
-				fprintf (out, " ");
-		}
-		fprintf (out, "\n");
-	}
-#endif
-
 	return ;
 }				/* dump_disk_lock */
 
@@ -236,8 +212,8 @@
 		rec = &(cl->cl_recs[i]);
 		fprintf(out, "\t## Bits Total    Bits Free      Disk Offset\n");
 
-		fprintf(out, "\t%-2d %-11u   %-12u   %llu\n", i, rec->c_total,
-			rec->c_free, (unsigned long long)rec->c_blkno);
+		fprintf(out, "\t%-2d %-11u   %-12u   %"PRIu64"\n", i, rec->c_total,
+			rec->c_free, rec->c_blkno);
 		traverse_chain(out, rec->c_blkno);
 		fprintf(out, "\n");
 	}
@@ -261,8 +237,8 @@
 
 	for (i = 0; i < ext->l_next_free_rec; ++i) {
 		rec = &(ext->l_recs[i]);
-		fprintf(out, "\t%-2d %-11u   %-12u   %llu\n", i, rec->e_cpos,
-			rec->e_clusters, (unsigned long long)rec->e_blkno);
+		fprintf(out, "\t%-2d %-11u   %-12u   %"PRIu64"\n",
+		       	i, rec->e_cpos, rec->e_clusters, rec->e_blkno);
 	}
 
 bail:
@@ -278,10 +254,9 @@
 	fprintf (out, "\tSubAlloc Bit: %u   SubAlloc Node: %u\n",
 		 blk->h_suballoc_bit, blk->h_suballoc_node);
 
-	fprintf (out, "\tBlknum: %llu   Parent: %llu   Next Leaf: %llu\n",
-		 (unsigned long long)blk->h_blkno,
-		 (unsigned long long)blk->h_parent_blk,
-		 (unsigned long long)blk->h_next_leaf_blk);
+	fprintf (out, "\tBlknum: %"PRIu64"   Parent: %"PRIu64"   "
+		 "Next Leaf: %"PRIu64"\n",
+		 blk->h_blkno, blk->h_parent_blk, blk->h_next_leaf_blk);
 
 	return ;
 }				/* dump_extent_block */
@@ -328,10 +303,10 @@
 		 blk->bg_bits,
 		 blk->bg_size);
 
-	fprintf (out, "\tNext Group: %llu   Parent Dinode: %llu  "
+	fprintf (out, "\tNext Group: %"PRIu64"   Parent Dinode: %"PRIu64"  "
 		 "Generation: %u\n",
-		 (unsigned long long)blk->bg_next_group,
-		 (unsigned long long)blk->bg_parent_dinode,
+		 blk->bg_next_group,
+		 blk->bg_parent_dinode,
 		 blk->bg_generation);
 
 	return ;
@@ -351,8 +326,8 @@
 
 	for (i = 0; i < arr->len; ++i) {
 		rec = &(g_array_index(arr, struct ocfs2_dir_entry, i));
-		fprintf(out, "\t%-15llu %-4u %-4u %-2u %s\n",
-			(unsigned long long)rec->inode, rec->rec_len,
+		fprintf(out, "\t%-15"PRIu64" %-4u %-4u %-2u %s\n",
+			rec->inode, rec->rec_len,
 			rec->name_len, rec->file_type, rec->name);
 	}
 
@@ -376,9 +351,9 @@
 
 	hdr = (ocfs_node_config_hdr *)buf;
 
-	fprintf(out, "\tVersion: %u   Num Nodes: %u   Last Node: %u   Seqnum: %llu\n",
-		hdr->version, hdr->num_nodes, hdr->last_node,
-		(unsigned long long)hdr->cfg_seq_num);
+	fprintf(out, "\tVersion: %u   Num Nodes: %u   Last Node: %u   "
+		"Seqnum: %"PRIu64"\n",
+		hdr->version, hdr->num_nodes, hdr->last_node, hdr->cfg_seq_num);
 
 	dump_disk_lock (out, &(hdr->disk_lock));
 
@@ -430,12 +405,10 @@
 		pub_flag = g_string_new (NULL);
 		get_publish_flag (pub->vote_type, pub_flag);
 
-		fprintf(out, "\t%3d  %1u   %1u   %1u  %-15llu %-15llu %-15llu %-15llu ",
-			i, pub->mounted, pub->vote, pub->dirty,
-			(unsigned long long)pub->lock_id,
-			(unsigned long long)pub->publ_seq_num,
-			(unsigned long long)pub->comm_seq_num,
-			(unsigned long long)pub->time);
+		fprintf(out, "\t%3d  %1u   %1u   %1u  %-15"PRIu64" "
+			"%-15"PRIu64" %-15"PRIu64" %-15"PRIu64" ",
+			i, pub->mounted, pub->vote, pub->dirty, pub->lock_id,
+			pub->publ_seq_num, pub->comm_seq_num, pub->time);
 
 		for (j = 0; j < sb->s_max_nodes; j++)
 			fprintf (out, "%d",
@@ -474,10 +447,9 @@
 		vote_flag = g_string_new (NULL);
 		get_vote_flag (vote->type, vote_flag);
 
-		fprintf(out, "\t%3u %-2u %-1u %-15llu %-15llu %-s\n", i,
-			vote->node, vote->open_handle,
-			(unsigned long long)vote->lock_id,
-			(unsigned long long)vote->vote_seq_num, vote_flag->str);
+		fprintf(out, "\t%3u %-2u %-1u %-15"PRIu64" %-15"PRIu64" %-s\n", i,
+			vote->node, vote->open_handle, vote->lock_id,
+			vote->vote_seq_num, vote_flag->str);
 
 		g_string_free (vote_flag, 1);
 		p += (1 << gbls.blksz_bits);
@@ -563,7 +535,7 @@
 
 	tagflg = g_string_new (NULL);
 
-	fprintf (out, "\tBlock %llu: ", (unsigned long long)blknum);
+	fprintf (out, "\tBlock %"PRIu64": ", blknum);
 
 	switch (ntohl(header->h_blocktype)) {
 	case JFS_DESCRIPTOR_BLOCK:
@@ -633,7 +605,7 @@
  */
 void dump_jbd_metadata (FILE *out, int type, char *buf, __u64 blknum)
 {
-	fprintf (out, "\tBlock %llu: ", (unsigned long long)blknum);
+	fprintf (out, "\tBlock %"PRIu64": ", blknum);
 	switch (type) {
 	case 1:
 		fprintf(out, "Inode\n");
@@ -660,10 +632,10 @@
 void dump_jbd_unknown (FILE *out, __u64 start, __u64 end)
 {
 	if (start == end - 1)
-		fprintf (out, "\tBlock %llu: ", (unsigned long long)start);
+		fprintf (out, "\tBlock %"PRIu64": ", start);
 	else
-		fprintf (out, "\tBlock %llu to %llu: ", (unsigned long long)start,
-			 (unsigned long long)(end - 1));
+		fprintf (out, "\tBlock %"PRIu64" to %"PRIu64": ",
+			 start, (end - 1));
 	fprintf (out, "Unknown -- Probably Data\n\n");
 
 	return ;



More information about the Ocfs2-tools-commits mailing list