14 static int on_node(dirscan_t
*d
, dirscan_entry_t
*entry
, void *user
)
16 char *name
= escape(entry
->inode
->i_name
);
18 printf("inode: %*c%s%c s:%llx h:%d c:%d p:%llx b:%llx\n",
19 entry
->level
*2, ' ', name
,
20 (entry
->inode
->i_type
== OMFS_DIR
) ? '/' : ' ',
21 swap_be64(entry
->inode
->i_head
.h_self
), entry
->hindex
,
22 swap_be16(entry
->inode
->i_head
.h_crc
),
23 entry
->parent
, entry
->block
);
40 if (omfs_read_super(&info
))
42 printf ("Could not read super block\n");
45 printf("Filesystem volume name: %s\n", super
.s_name
);
46 printf("Filesystem magic number: 0x%x\n", swap_be32(super
.s_magic
));
47 printf("First block: 0x%llx\n", swap_be64(super
.s_root_block
));
48 printf("Block count: 0x%llx\n", swap_be64(super
.s_num_blocks
));
49 printf("Block size: %d\n", swap_be32(super
.s_blocksize
));
50 printf("Inode block size: %d\n", swap_be32(super
.s_sys_blocksize
));
51 printf("Mirrors: %d\n", swap_be32(super
.s_mirrors
));
54 if (omfs_read_root_block(&info
))
56 printf ("Could not read root block\n");
59 printf("Root block size: %d\n", swap_be32(info
.root
->r_blocksize
));
60 printf("Cluster size: %d\n", swap_be32(info
.root
->r_clustersize
));
61 printf("Root mirrors: %d\n", swap_be32(info
.root
->r_mirrors
));
63 bsize
= (swap_be64(info
.super
->s_num_blocks
) + 7) / 8;
65 if (dirscan_begin(&info
, on_node
, NULL
) != 0)
67 printf("Dirscan failed\n");