Changeset f5cbd4f in mainline


Ignore:
Timestamp:
2011-03-07T20:37:33Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
59e670e
Parents:
bc99ed6
Message:

Some little code fix

File:
1 edited

Legend:

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

    rbc99ed6 rf5cbd4f  
    6363
    6464typedef struct mfs_params {
     65        int             fs_version;
    6566        devmap_handle_t handle;
    6667        uint16_t        fs_magic;
     
    7576static int      num_of_set_bits(uint32_t n);
    7677static void     init_superblock(struct mfs_superblock *sb, mfs_params_t *opt);
    77 static void     init_superblock_v3(struct mfs3_superblock *sb, mfs_params_t *opt);
    78 static void     init_bitmaps(uint32_t ninodes,  uint32_t nzones, int bsize, mfs_params_t *opt);
     78static void     init_superblock_v3(struct mfs3_superblock *sb,
     79                                        mfs_params_t *opt);
     80static void     init_bitmaps(uint32_t ninodes,  uint32_t nzones,
     81                                int bsize, mfs_params_t *opt);
    7982static void     mark_bmap(uint8_t *bmap, int idx, int v);
    8083
     
    123126                        opt.fs_magic = MFS_MAGIC_V1;
    124127                        opt.block_size = MFS_BLOCKSIZE;
     128                        opt.fs_version = 1;
    125129                        break;
    126130                case '2':
    127131                        opt.fs_magic = MFS_MAGIC_V2;
    128132                        opt.block_size = MFS_BLOCKSIZE;
     133                        opt.fs_version = 2;
    129134                        break;
    130135                case '3':
    131136                        opt.fs_magic = MFS_MAGIC_V3;
     137                        opt.fs_version = 3;
    132138                        break;
    133139                case 'b':
     
    231237{
    232238        int ino_per_block = 0;
    233         int fs_version;
    234239        aoff64_t inodes;
    235240
    236         if (opt->fs_magic == MFS_MAGIC_V1) {
    237                 fs_version = 1;
     241        if (opt->fs_version == 1) {
    238242                ino_per_block = V1_INODES_PER_BLOCK;
    239243                if (opt->fs_longnames)
    240244                        opt->fs_magic = MFS_MAGIC_V1L;
    241245        } else {
    242                 fs_version = 2;
    243246                ino_per_block = V2_INODES_PER_BLOCK;
    244247                if (opt->fs_longnames)
     
    272275
    273276        /*Compute zone bitmap size in blocks*/
    274         if (fs_version == 1)
     277        if (opt->fs_version == 1)
    275278                sb->s_zbmap_blocks = UPPER(sb->s_nzones, MFS_BLOCKSIZE * 8);
    276279        else
     
    364367        memset(zbmap_buf, 0xFF, zbmap_nblocks * bsize);
    365368
    366         for (i = 2; i < ninodes; ++i) {
     369        for (i = 2; i < ninodes; ++i)
    367370                mark_bmap(ibmap_buf, i, FREE);
     371
     372        for (i = 2; i < nzones; ++i)
    368373                mark_bmap(zbmap_buf, i, FREE);
    369         }
    370374
    371375        ibmap_nblocks *= bsize / MFS_BLOCKSIZE;
Note: See TracChangeset for help on using the changeset viewer.