Changeset e91b898 in mainline
- Timestamp:
- 2011-07-28T19:13:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 99f043e
- Parents:
- 5b38ecf0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkminix/mkminix.c
r5b38ecf0 re91b898 101 101 102 102 static struct option const long_options[] = { 103 { "help", no_argument, 0, 'h' },104 { "long-names", no_argument, 0, 'l' },105 { "block-size", required_argument, 0, 'b' },106 { "inodes", required_argument, 0, 'i' },107 { NULL, no_argument, 0, '1' },108 { NULL, no_argument, 0, '2' },109 { 0, 0, 0, 0 }103 { "help", no_argument, 0, 'h' }, 104 { "long-names", no_argument, 0, 'l' }, 105 { "block-size", required_argument, 0, 'b' }, 106 { "inodes", required_argument, 0, 'i' }, 107 { NULL, no_argument, 0, '1' }, 108 { NULL, no_argument, 0, '2' }, 109 { 0, 0, 0, 0 } 110 110 }; 111 111 … … 169 169 170 170 if (sb.block_size < MFS_MIN_BLOCKSIZE || 171 171 sb.block_size > MFS_MAX_BLOCKSIZE) { 172 172 printf(NAME ":Error! Invalid block size.\n"); 173 173 exit(0); … … 224 224 } else { 225 225 printf(NAME ": Block device has %" PRIuOFF64 " blocks.\n", 226 226 sb.dev_nblocks); 227 227 } 228 228 … … 295 295 296 296 dentry_ptr = root_block; 297 297 298 298 if (sb->fs_version != 3) { 299 299 /*Directory entries for V1/V2 filesystem*/ … … 304 304 305 305 dentry = (struct mfs_dentry *) NEXT_DENTRY(dentry_ptr, 306 306 sb->dirsize); 307 307 308 308 dentry->d_inum = MFS_ROOT_INO; … … 316 316 317 317 dentry = (struct mfs3_dentry *) NEXT_DENTRY(dentry_ptr, 318 318 sb->dirsize); 319 319 320 320 dentry->d_inum = MFS_ROOT_INO; … … 387 387 ino_buf[MFS_ROOT_INO - 1].i_gid = 0; 388 388 ino_buf[MFS_ROOT_INO - 1].i_size = (sb->longnames ? MFSL_DIRSIZE : 389 389 MFS_DIRSIZE) * 2; 390 390 ino_buf[MFS_ROOT_INO - 1].i_mtime = sec; 391 391 ino_buf[MFS_ROOT_INO - 1].i_nlinks = 2; … … 456 456 /*Valid only for MFS V1*/ 457 457 sb->n_zones = sb->dev_nblocks > UINT16_MAX ? 458 UINT16_MAX : sb->dev_nblocks;458 UINT16_MAX : sb->dev_nblocks; 459 459 } else { 460 460 /*Valid for MFS V2/V3*/ 461 461 sb->n_zones = sb->dev_nblocks > UINT32_MAX ? 462 UINT32_MAX : sb->dev_nblocks;462 UINT32_MAX : sb->dev_nblocks; 463 463 464 464 if (sb->fs_version == 3) { … … 476 476 if (inodes % sb->ino_per_block) 477 477 inodes = ((inodes / sb->ino_per_block) + 1) * sb->ino_per_block; 478 478 479 479 if (sb->fs_version < 3) 480 480 sb->n_inodes = inodes > UINT16_MAX ? UINT16_MAX : inodes; … … 493 493 /*Compute first data zone position*/ 494 494 sb->first_data_zone = 2 + sb->itable_size + 495 495 sb->zbmap_blocks + sb->ibmap_blocks; 496 496 497 497 /*Set log2 of zone to block ratio to zero*/ … … 690 690 printf(NAME": tool to create new Minix file systems\n"); 691 691 } else { 692 printf("Usage: [options] device\n"693 "-1 Make a Minix version 1 filesystem\n"694 "-2 Make a Minix version 2 filesystem\n"695 "-b ## Specify the block size in bytes (V3 only),\n"696 " valid block size values are 1024, 2048 and 4096 bytes per block\n"697 "-i ## Specify the number of inodes for the filesystem\n"698 "-l Use 30-char long filenames (V1/V2 only)\n");692 printf("Usage: [options] device\n" 693 "-1 Make a Minix version 1 filesystem\n" 694 "-2 Make a Minix version 2 filesystem\n" 695 "-b ## Specify the block size in bytes (V3 only),\n" 696 " valid block size values are 1024, 2048 and 4096 bytes per block\n" 697 "-i ## Specify the number of inodes for the filesystem\n" 698 "-l Use 30-char long filenames (V1/V2 only)\n"); 699 699 } 700 700 }
Note:
See TracChangeset
for help on using the changeset viewer.