Changeset bb0db564 in mainline
- Timestamp:
- 2011-03-09T20:31:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b00a2f2
- Parents:
- 340b5690
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkminix/mkminix.c
r340b5690 rbb0db564 547 547 static int init_bitmaps(struct mfs_sb_info *sb) 548 548 { 549 uint8_t *ibmap_buf, *zbmap_buf; 549 uint32_t *ibmap_buf, *zbmap_buf; 550 uint8_t *ibmap_buf8, *zbmap_buf8; 550 551 unsigned int ibmap_nblocks = sb->ibmap_blocks; 551 552 unsigned int zbmap_nblocks = sb->zbmap_blocks; … … 553 554 int rc; 554 555 555 printf("Initializing bitmaps..."); 556 557 ibmap_buf = (uint8_t *) malloc(ibmap_nblocks * sb->block_size); 558 zbmap_buf = (uint8_t *) malloc(zbmap_nblocks * sb->block_size); 556 ibmap_buf = (uint32_t *) malloc(ibmap_nblocks * sb->block_size); 557 zbmap_buf = (uint32_t *) malloc(zbmap_nblocks * sb->block_size); 559 558 560 559 if (!ibmap_buf || !zbmap_buf) … … 565 564 566 565 for (i = 2; i < sb->n_inodes; ++i) 567 mark_bmap( (uint32_t*)ibmap_buf, i, FREE);566 mark_bmap(ibmap_buf, i, FREE); 568 567 569 568 for (i = sb->first_data_zone + 1; i < sb->n_zones; ++i) 570 mark_bmap((uint32_t *) zbmap_buf, i, FREE); 571 569 mark_bmap(zbmap_buf, i, FREE); 570 571 /*Convert to 1K block offsets*/ 572 572 ibmap_nblocks *= sb->block_size / MFS_BLOCKSIZE; 573 573 zbmap_nblocks *= sb->block_size / MFS_BLOCKSIZE; 574 574 575 ibmap_buf8 = (uint8_t *) ibmap_buf; 576 zbmap_buf8 = (uint8_t *) zbmap_buf; 577 575 578 for (i = 0; i < ibmap_nblocks; ++i) { 576 579 if ((rc = block_write_direct(sb->handle, 2 + i, 577 1, (ibmap_buf + i * MFS_BLOCKSIZE))) != EOK)580 1, (ibmap_buf8 + i * MFS_BLOCKSIZE))) != EOK) 578 581 return rc; 579 582 } … … 581 584 for (i = 0; i < zbmap_nblocks; ++i) { 582 585 if ((rc = block_write_direct(sb->handle, 2 + ibmap_nblocks + i, 583 1, (zbmap_buf + i * MFS_BLOCKSIZE))) != EOK)586 1, (zbmap_buf8 + i * MFS_BLOCKSIZE))) != EOK) 584 587 return rc; 585 588 } 586 587 printf("Done.\n");588 589 589 590 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.