Changeset e91b898 in mainline for uspace/app/mkminix/mkminix.c


Ignore:
Timestamp:
2011-07-28T19:13:00Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
99f043e
Parents:
5b38ecf0
Message:

cstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkminix/mkminix.c

    r5b38ecf0 re91b898  
    101101
    102102static 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 }
    110110};
    111111
     
    169169
    170170        if (sb.block_size < MFS_MIN_BLOCKSIZE ||
    171                                 sb.block_size > MFS_MAX_BLOCKSIZE) {
     171                        sb.block_size > MFS_MAX_BLOCKSIZE) {
    172172                printf(NAME ":Error! Invalid block size.\n");
    173173                exit(0);
     
    224224        } else {
    225225                printf(NAME ": Block device has %" PRIuOFF64 " blocks.\n",
    226                     sb.dev_nblocks);
     226                                sb.dev_nblocks);
    227227        }
    228228
     
    295295
    296296        dentry_ptr = root_block;
    297        
     297
    298298        if (sb->fs_version != 3) {
    299299                /*Directory entries for V1/V2 filesystem*/
     
    304304
    305305                dentry = (struct mfs_dentry *) NEXT_DENTRY(dentry_ptr,
    306                                                         sb->dirsize);
     306                                sb->dirsize);
    307307
    308308                dentry->d_inum = MFS_ROOT_INO;
     
    316316
    317317                dentry = (struct mfs3_dentry *) NEXT_DENTRY(dentry_ptr,
    318                                                         sb->dirsize);
     318                                sb->dirsize);
    319319
    320320                dentry->d_inum = MFS_ROOT_INO;
     
    387387        ino_buf[MFS_ROOT_INO - 1].i_gid = 0;
    388388        ino_buf[MFS_ROOT_INO - 1].i_size = (sb->longnames ? MFSL_DIRSIZE :
    389                                                 MFS_DIRSIZE) * 2;
     389        MFS_DIRSIZE) * 2;
    390390        ino_buf[MFS_ROOT_INO - 1].i_mtime = sec;
    391391        ino_buf[MFS_ROOT_INO - 1].i_nlinks = 2;
     
    456456                /*Valid only for MFS V1*/
    457457                sb->n_zones = sb->dev_nblocks > UINT16_MAX ?
    458                         UINT16_MAX : sb->dev_nblocks;
     458                                UINT16_MAX : sb->dev_nblocks;
    459459        } else {
    460460                /*Valid for MFS V2/V3*/
    461461                sb->n_zones = sb->dev_nblocks > UINT32_MAX ?
    462                         UINT32_MAX : sb->dev_nblocks;
     462                                UINT32_MAX : sb->dev_nblocks;
    463463
    464464                if (sb->fs_version == 3) {
     
    476476        if (inodes % sb->ino_per_block)
    477477                inodes = ((inodes / sb->ino_per_block) + 1) * sb->ino_per_block;
    478        
     478
    479479        if (sb->fs_version < 3)
    480480                sb->n_inodes = inodes > UINT16_MAX ? UINT16_MAX : inodes;
     
    493493        /*Compute first data zone position*/
    494494        sb->first_data_zone = 2 + sb->itable_size +
    495                                 sb->zbmap_blocks + sb->ibmap_blocks;
     495                        sb->zbmap_blocks + sb->ibmap_blocks;
    496496
    497497        /*Set log2 of zone to block ratio to zero*/
     
    690690                printf(NAME": tool to create new Minix file systems\n");
    691691        } 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");
    699699        }
    700700}
Note: See TracChangeset for help on using the changeset viewer.