[Ocfs2-tools-commits] zab commits r1041 -
branches/endian-safe/debugfs.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Aug 12 13:04:20 CDT 2005
Author: zab
Date: 2005-08-12 13:04:18 -0500 (Fri, 12 Aug 2005)
New Revision: 1041
Modified:
branches/endian-safe/debugfs.ocfs2/dump.c
Log:
get debugfs treating endian differences properly
o continue to swap journal bits manually
o don't swap inode truncate log goo that libocfs2 has swapped
o swap slot_map
Modified: branches/endian-safe/debugfs.ocfs2/dump.c
===================================================================
--- branches/endian-safe/debugfs.ocfs2/dump.c 2005-08-12 16:26:21 UTC (rev 1040)
+++ branches/endian-safe/debugfs.ocfs2/dump.c 2005-08-12 18:04:18 UTC (rev 1041)
@@ -93,15 +93,15 @@
int i;
fprintf(out, "\tTotal Records: %u Used: %u\n",
- le16_to_cpu(tl->tl_count), le16_to_cpu(tl->tl_used));
+ tl->tl_count, tl->tl_used);
fprintf(out, "\t## %-10s %-10s\n", "Start Cluster",
"Num Clusters");
- for(i = 0; i < le16_to_cpu(tl->tl_used); i++)
+ for(i = 0; i < tl->tl_used; i++)
fprintf(out, "\t%-2d %-10u %-10u\n",
- i, le32_to_cpu(tl->tl_recs[i].t_start),
- le32_to_cpu(tl->tl_recs[i].t_clusters));
+ i, tl->tl_recs[i].t_start,
+ tl->tl_recs[i].t_clusters);
return ;
}
@@ -200,12 +200,12 @@
str = ctime((time_t*)&in->i_dtime);
fprintf(out, "\tdtime: 0x%"PRIx64" -- %s", in->i_dtime, str);
- fprintf(out, "\tctime_nsec: 0x%x -- %u\n",
- le32_to_cpu(in->i_ctime_nsec), le32_to_cpu(in->i_ctime));
- fprintf(out, "\tatime_nsec: 0x%x -- %u\n",
- le32_to_cpu(in->i_atime_nsec), le32_to_cpu(in->i_atime_nsec));
- fprintf(out, "\tmtime_nsec: 0x%x -- %u\n",
- le32_to_cpu(in->i_mtime_nsec), le32_to_cpu(in->i_mtime_nsec));
+ fprintf(out, "\tctime_nsec: 0x%08"PRIx32" -- %u\n",
+ in->i_ctime_nsec, in->i_ctime_nsec);
+ fprintf(out, "\tatime_nsec: 0x%08"PRIx32" -- %u\n",
+ in->i_atime_nsec, in->i_atime_nsec);
+ fprintf(out, "\tmtime_nsec: 0x%08"PRIx32" -- %u\n",
+ in->i_mtime_nsec, in->i_mtime_nsec);
fprintf(out, "\tLast Extblk: %"PRIu64"\n", in->i_last_eb_blk);
if (in->i_suballoc_slot == OCFS2_INVALID_SLOT)
@@ -401,10 +401,11 @@
fprintf (out, "\tError: %d\n", ntohl(jsb->s_errno));
- /* XXX not sure what to do about swabbing these */
- fprintf (out, "\tFeatures Compat: %u Incompat: %u RO Compat: %u\n",
- jsb->s_feature_compat, jsb->s_feature_incompat,
- jsb->s_feature_ro_compat);
+ fprintf (out, "\tFeatures Compat: 0x%"PRIx32" "
+ "Incompat: 0x%"PRIx32" RO Compat: 0x%"PRIx32"\n",
+ ntohl(jsb->s_feature_compat),
+ ntohl(jsb->s_feature_incompat),
+ ntohl(jsb->s_feature_ro_compat));
fprintf (out, "\tJournal UUID: ");
for(i = 0; i < 16; i++)
@@ -561,9 +562,11 @@
fprintf (out, "\t%5s %5s\n", "Slot#", "Node#");
for (i = 0; i < num_slots; ++i) {
- if (slots[i] != -1)
- fprintf (out, "\t%5d %5d\n",
- i, slots[i]);
+ uint16_t slot = le16_to_cpu(slots[i]);
+ if (slot == (uint16_t)OCFS2_INVALID_SLOT)
+ continue;
+
+ fprintf (out, "\t%5d %5u\n", i, slot);
}
return ;
More information about the Ocfs2-tools-commits
mailing list