[Ocfs2-tools-commits] zab commits r349 - trunk/fsck.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Oct 27 18:48:34 CDT 2004
Author: zab
Date: 2004-10-27 18:48:32 -0500 (Wed, 27 Oct 2004)
New Revision: 349
Modified:
trunk/fsck.ocfs2/fsck.c
Log:
o print the label, uuid, and max_nodes for the volume
Modified: trunk/fsck.ocfs2/fsck.c
===================================================================
--- trunk/fsck.ocfs2/fsck.c 2004-10-27 23:37:29 UTC (rev 348)
+++ trunk/fsck.ocfs2/fsck.c 2004-10-27 23:48:32 UTC (rev 349)
@@ -204,6 +204,35 @@
return;
}
+static void print_label(o2fsck_state *ost)
+{
+ char *label = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_label;
+ size_t i, max = sizeof(OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_label);
+
+ for(i = 0; i < max && label[i]; i++) {
+ if (isprint(label[i]))
+ printf("%c", label[i]);
+ else
+ printf(".");
+ }
+ if (i == 0)
+ printf("<NONE>");
+
+ printf("\n");
+}
+
+static void print_uuid(o2fsck_state *ost)
+{
+ unsigned char *uuid = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_uuid;
+ size_t i, max = sizeof(OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_uuid);
+
+ for(i = 0; i < max; i++)
+ printf("%02x ", uuid[i]);
+
+ printf("\n");
+}
+
+
int main(int argc, char **argv)
{
char *filename;
@@ -325,10 +354,16 @@
/* XXX we don't use the bad blocks inode, do we? */
printf("Checking OCFS2 filesystem in %s:\n", filename);
+ printf(" label: ");
+ print_label(ost);
+ printf(" uuid: ");
+ print_uuid(ost);
printf(" number of blocks: %"PRIu64"\n", ost->ost_fs->fs_blocks);
printf(" bytes per block: %u\n", ost->ost_fs->fs_blocksize);
printf(" number of clusters: %"PRIu32"\n", ost->ost_fs->fs_clusters);
printf(" bytes per cluster: %u\n", ost->ost_fs->fs_clustersize);
+ printf(" max nodes: %u\n",
+ OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes);
ret = o2fsck_replay_journals(ost);
if (ret) {
More information about the Ocfs2-tools-commits
mailing list