Changeset f6fa2c2 in mainline for uspace/app/ext2info/ext2info.c
- Timestamp:
- 2011-02-14T20:24:40Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3949e8a0
- Parents:
- c00e729
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/ext2info/ext2info.c
rc00e729 rf6fa2c2 117 117 uint32_t first_inode; 118 118 uint16_t inode_size; 119 uint32_t total_blocks; 120 uint32_t reserved_blocks; 121 uint32_t free_blocks; 122 uint32_t total_inodes; 123 uint32_t free_inodes; 124 uint32_t os; 119 125 120 126 int pos; … … 132 138 first_inode = ext2_superblock_get_first_inode(superblock); 133 139 inode_size = ext2_superblock_get_inode_size(superblock); 140 total_blocks = ext2_superblock_get_total_block_count(superblock); 141 reserved_blocks = ext2_superblock_get_reserved_block_count(superblock); 142 free_blocks = ext2_superblock_get_free_block_count(superblock); 143 total_inodes = ext2_superblock_get_total_inode_count(superblock); 144 free_inodes = ext2_superblock_get_free_inode_count(superblock); 145 os = ext2_superblock_get_os(superblock); 134 146 135 147 printf("Superblock:\n"); … … 144 156 printf(" Revision: %u.%hu\n", rev_major, rev_minor); 145 157 printf(" State: %hu\n", state); 158 printf(" Creator OS: %u\n", os); 146 159 printf(" First block: %u\n", first_block); 147 160 printf(" Block size: %u bytes (%u KiB)\n", block_size, block_size/1024); 148 161 printf(" Blocks per group: %u\n", blocks_per_group); 162 printf(" Total blocks: %u\n", total_blocks); 163 printf(" Reserved blocks: %u\n", reserved_blocks); 164 printf(" Free blocks: %u\n", free_blocks); 149 165 printf(" Fragment size: %u bytes (%u KiB)\n", fragment_size, 150 166 fragment_size/1024); … … 152 168 printf(" First inode: %u\n", first_inode); 153 169 printf(" Inode size: %hu bytes\n", inode_size); 170 printf(" Total inodes: %u\n", total_inodes); 171 printf(" Free inodes: %u\n", free_inodes); 154 172 155 printf(" UUID: "); 156 for (pos = 0; pos < 16; pos++) { 157 printf("%02x", superblock->uuid[pos]); 173 174 if (rev_major == 1) { 175 printf(" UUID: "); 176 for (pos = 0; pos < 16; pos++) { 177 printf("%02x", superblock->uuid[pos]); 178 } 179 printf("\n"); 180 181 printf(" Volume label: "); 182 for (pos = 0; pos < 16; pos++) { 183 c = superblock->volume_name[pos]; 184 if (c >= 32 && c < 128) { 185 putchar(c); 186 } 187 else { 188 putchar(' '); 189 } 190 } 191 printf("\n"); 158 192 } 159 printf("\n");160 161 printf(" Volume label: ");162 for (pos = 0; pos < 16; pos++) {163 c = superblock->volume_name[pos];164 if (c >= 32 && c < 128) {165 putchar(c);166 }167 else {168 putchar(' ');169 }170 }171 printf("\n");172 193 173 194 }
Note:
See TracChangeset
for help on using the changeset viewer.