Changeset e2267e82 in mainline


Ignore:
Timestamp:
2011-03-06T22:38:34Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e80b1de
Parents:
e03a733
Message:

code cleanup

File:
1 edited

Legend:

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

    re03a733 re2267e82  
    236236        int ino_per_block = 0;
    237237        int fs_version;
    238         aoff64_t tmp;
     238        aoff64_t inodes;
    239239
    240240        if (opt->fs_magic == MFS_MAGIC_V1) {
     
    264264        /*Round up the number of inodes to fill block size*/
    265265        if (opt->n_inodes == 0)
    266                 tmp = opt->dev_nblocks / 3;             
     266                inodes = opt->dev_nblocks / 3;         
    267267        else
    268                 tmp = opt->n_inodes;
    269 
    270         if (tmp % ino_per_block)
    271                 tmp = ((tmp / ino_per_block) + 1) * ino_per_block;
    272         sb->s_ninodes = tmp > UINT16_MAX ? UINT16_MAX : tmp;
     268                inodes = opt->n_inodes;
     269
     270        if (inodes % ino_per_block)
     271                inodes = ((inodes / ino_per_block) + 1) * ino_per_block;
     272        sb->s_ninodes = inodes > UINT16_MAX ? UINT16_MAX : inodes;
    273273
    274274        /*Compute inode bitmap size in blocks*/
     
    303303        int ino_per_block;
    304304        int bs;
    305         aoff64_t tmp;
     305        aoff64_t inodes;
    306306
    307307        sb->s_magic = opt->fs_magic;
     
    309309
    310310        if (opt->n_inodes == 0)
    311                 tmp = opt->dev_nblocks / 3;             
     311                inodes = opt->dev_nblocks / 3;         
    312312        else
    313                 tmp = opt->n_inodes;
     313                inodes = opt->n_inodes;
     314
     315        /*Round up the number of inodes to fill block size*/
     316        ino_per_block = V3_INODES_PER_BLOCK(bs);
     317        if (inodes % ino_per_block)
     318                inodes = ((inodes / ino_per_block) + 1) * ino_per_block;
     319        sb->s_ninodes = inodes > UINT32_MAX ? UINT32_MAX : inodes;
    314320
    315321        /*Compute the number of zones on disk*/
     
    317323                        UINT32_MAX : opt->dev_nblocks;
    318324        sb->s_nzones /= (bs / MFS_MIN_BLOCKSIZE);
    319 
    320         /*Round up the number of inodes to fill block size*/
    321         ino_per_block = V3_INODES_PER_BLOCK(bs);
    322         if (tmp % ino_per_block)
    323                 tmp = ((tmp / ino_per_block) + 1) * ino_per_block;
    324         sb->s_ninodes = tmp > UINT32_MAX ? UINT32_MAX : tmp;
    325325
    326326        /*Compute inode bitmap size in blocks*/
Note: See TracChangeset for help on using the changeset viewer.