Changeset f5cbd4f in mainline
- Timestamp:
- 2011-03-07T20:37:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 59e670e
- Parents:
- bc99ed6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkminix/mkminix.c
rbc99ed6 rf5cbd4f 63 63 64 64 typedef struct mfs_params { 65 int fs_version; 65 66 devmap_handle_t handle; 66 67 uint16_t fs_magic; … … 75 76 static int num_of_set_bits(uint32_t n); 76 77 static 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); 78 static void init_superblock_v3(struct mfs3_superblock *sb, 79 mfs_params_t *opt); 80 static void init_bitmaps(uint32_t ninodes, uint32_t nzones, 81 int bsize, mfs_params_t *opt); 79 82 static void mark_bmap(uint8_t *bmap, int idx, int v); 80 83 … … 123 126 opt.fs_magic = MFS_MAGIC_V1; 124 127 opt.block_size = MFS_BLOCKSIZE; 128 opt.fs_version = 1; 125 129 break; 126 130 case '2': 127 131 opt.fs_magic = MFS_MAGIC_V2; 128 132 opt.block_size = MFS_BLOCKSIZE; 133 opt.fs_version = 2; 129 134 break; 130 135 case '3': 131 136 opt.fs_magic = MFS_MAGIC_V3; 137 opt.fs_version = 3; 132 138 break; 133 139 case 'b': … … 231 237 { 232 238 int ino_per_block = 0; 233 int fs_version;234 239 aoff64_t inodes; 235 240 236 if (opt->fs_magic == MFS_MAGIC_V1) { 237 fs_version = 1; 241 if (opt->fs_version == 1) { 238 242 ino_per_block = V1_INODES_PER_BLOCK; 239 243 if (opt->fs_longnames) 240 244 opt->fs_magic = MFS_MAGIC_V1L; 241 245 } else { 242 fs_version = 2;243 246 ino_per_block = V2_INODES_PER_BLOCK; 244 247 if (opt->fs_longnames) … … 272 275 273 276 /*Compute zone bitmap size in blocks*/ 274 if ( fs_version == 1)277 if (opt->fs_version == 1) 275 278 sb->s_zbmap_blocks = UPPER(sb->s_nzones, MFS_BLOCKSIZE * 8); 276 279 else … … 364 367 memset(zbmap_buf, 0xFF, zbmap_nblocks * bsize); 365 368 366 for (i = 2; i < ninodes; ++i) {369 for (i = 2; i < ninodes; ++i) 367 370 mark_bmap(ibmap_buf, i, FREE); 371 372 for (i = 2; i < nzones; ++i) 368 373 mark_bmap(zbmap_buf, i, FREE); 369 }370 374 371 375 ibmap_nblocks *= bsize / MFS_BLOCKSIZE;
Note:
See TracChangeset
for help on using the changeset viewer.