Changeset 9cfe0d5 in mainline
- Timestamp:
- 2011-03-06T17:21:19Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ae1ae27
- Parents:
- e6aaa59
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkminix/mkminix.c
re6aaa59 r9cfe0d5 73 73 static void setup_superblock(struct mfs_superblock *sb, mfs_params_t *opt); 74 74 static void setup_superblock_v3(struct mfs3_superblock *sb, mfs_params_t *opt); 75 static void setup_bitmaps(devmap_handle_t handle, uint32_t ninodes, uint32_t nzones); 75 static void setup_bitmaps(devmap_handle_t handle, uint32_t ninodes, 76 uint32_t nzones, int bsize); 76 77 static void mark_bmap(uint8_t *bmap, int idx, int v); 77 78 … … 212 213 } 213 214 setup_superblock_v3(sb3, &opt); 214 setup_bitmaps(handle, sb3->s_ninodes, sb3->s_total_zones); 215 setup_bitmaps(handle, sb3->s_ninodes, 216 sb3->s_total_zones, sb3->s_block_size); 215 217 } else { 216 218 sb = (struct mfs_superblock *) malloc(sizeof(struct mfs_superblock)); … … 221 223 setup_superblock(sb, &opt); 222 224 block_write_direct(handle, MFS_SUPERBLOCK, 1, sb); 223 setup_bitmaps(handle, sb->s_ninodes, sb->s_nzones );225 setup_bitmaps(handle, sb->s_ninodes, sb->s_nzones, MFS_BLOCKSIZE); 224 226 } 225 227 … … 291 293 } 292 294 293 static void setup_bitmaps(devmap_handle_t handle, uint32_t ninodes, uint32_t nzones) 295 static void setup_bitmaps(devmap_handle_t handle, uint32_t ninodes, 296 uint32_t nzones, int bsize) 294 297 { 295 298 uint8_t *ibmap_buf, *zbmap_buf; 296 int ibmap_nblocks = 1 + (ninodes / 8) / MFS_BLOCKSIZE;297 int zbmap_nblocks = 1 + (nzones / 8) / MFS_BLOCKSIZE;299 int ibmap_nblocks = 1 + (ninodes / 8) / bsize; 300 int zbmap_nblocks = 1 + (nzones / 8) / bsize; 298 301 unsigned int i; 299 302 300 ibmap_buf = (uint8_t *) malloc(ibmap_nblocks * MFS_BLOCKSIZE);301 zbmap_buf = (uint8_t *) malloc(zbmap_nblocks * MFS_BLOCKSIZE);302 303 memset(ibmap_buf, 0xFF, ibmap_nblocks * MFS_BLOCKSIZE);304 memset(zbmap_buf, 0xFF, zbmap_nblocks * MFS_BLOCKSIZE);303 ibmap_buf = (uint8_t *) malloc(ibmap_nblocks * bsize); 304 zbmap_buf = (uint8_t *) malloc(zbmap_nblocks * bsize); 305 306 memset(ibmap_buf, 0xFF, ibmap_nblocks * bsize); 307 memset(zbmap_buf, 0xFF, zbmap_nblocks * bsize); 305 308 306 309 for (i = 2; i < ninodes; ++i) { … … 308 311 mark_bmap(zbmap_buf, i, FREE); 309 312 } 313 314 ibmap_nblocks *= bsize / MFS_BLOCKSIZE; 315 zbmap_nblocks *= bsize / MFS_BLOCKSIZE; 310 316 311 317 block_write_direct(handle, 2, ibmap_nblocks, ibmap_buf);
Note:
See TracChangeset
for help on using the changeset viewer.