Changes in uspace/app/mkmfs/mkmfs.c [cde999a:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkmfs/mkmfs.c
rcde999a rb7fd2a0 82 82 static void help_cmd_mkmfs(help_level_t level); 83 83 static bool is_power_of_two(uint32_t n); 84 static int init_superblock(struct mfs_sb_info *sb);85 static int write_superblock(const struct mfs_sb_info *sbi);86 static int write_superblock3(const struct mfs_sb_info *sbi);87 static int init_bitmaps(const struct mfs_sb_info *sb);88 static int init_inode_table(const struct mfs_sb_info *sb);89 static int make_root_ino(const struct mfs_sb_info *sb);90 static int make_root_ino2(const struct mfs_sb_info *sb);84 static errno_t init_superblock(struct mfs_sb_info *sb); 85 static errno_t write_superblock(const struct mfs_sb_info *sbi); 86 static errno_t write_superblock3(const struct mfs_sb_info *sbi); 87 static errno_t init_bitmaps(const struct mfs_sb_info *sb); 88 static errno_t init_inode_table(const struct mfs_sb_info *sb); 89 static errno_t make_root_ino(const struct mfs_sb_info *sb); 90 static errno_t make_root_ino2(const struct mfs_sb_info *sb); 91 91 static void mark_bmap(uint32_t *bmap, int idx, int v); 92 static int insert_dentries(const struct mfs_sb_info *sb);93 94 static inline int write_block(aoff64_t off, size_t size, const void *data);92 static errno_t insert_dentries(const struct mfs_sb_info *sb); 93 94 static inline errno_t write_block(aoff64_t off, size_t size, const void *data); 95 95 96 96 static service_id_t service_id; … … 109 109 int main (int argc, char **argv) 110 110 { 111 int rc;111 errno_t rc; 112 112 int c, opt_ind; 113 113 char *device_name; … … 292 292 * @return EOK on success or an error code. 293 293 */ 294 static int insert_dentries(const struct mfs_sb_info *sb)294 static errno_t insert_dentries(const struct mfs_sb_info *sb) 295 295 { 296 296 void *root_block; 297 297 uint8_t *dentry_ptr; 298 int rc;298 errno_t rc; 299 299 const long root_dblock = sb->first_data_zone; 300 300 … … 345 345 * @return EOK on success or an error code. 346 346 */ 347 static int init_inode_table(const struct mfs_sb_info *sb)347 static errno_t init_inode_table(const struct mfs_sb_info *sb) 348 348 { 349 349 unsigned int i; 350 350 uint8_t *itable_buf; 351 int rc = EOK;351 errno_t rc = EOK; 352 352 353 353 long itable_off = sb->zbmap_blocks + sb->ibmap_blocks + 2; … … 378 378 * @return EOK on success or an error code. 379 379 */ 380 static int make_root_ino(const struct mfs_sb_info *sb)380 static errno_t make_root_ino(const struct mfs_sb_info *sb) 381 381 { 382 382 struct mfs_inode *ino_buf; 383 int rc;383 errno_t rc; 384 384 385 385 const long itable_off = sb->zbmap_blocks + sb->ibmap_blocks + 2; … … 415 415 * @return EOK on success or an error code. 416 416 */ 417 static int make_root_ino2(const struct mfs_sb_info *sb)417 static errno_t make_root_ino2(const struct mfs_sb_info *sb) 418 418 { 419 419 struct mfs2_inode *ino_buf; 420 int rc;420 errno_t rc; 421 421 422 422 /* Compute offset of the first inode table block */ … … 454 454 * @return EOK on success or an error code. 455 455 */ 456 static int init_superblock(struct mfs_sb_info *sb)456 static errno_t init_superblock(struct mfs_sb_info *sb) 457 457 { 458 458 aoff64_t inodes; … … 460 460 unsigned long ind2; 461 461 unsigned long zones; 462 int rc;462 errno_t rc; 463 463 464 464 if (sb->longnames) … … 561 561 * @return EOK on success or an error code. 562 562 */ 563 static int write_superblock(const struct mfs_sb_info *sbi)563 static errno_t write_superblock(const struct mfs_sb_info *sbi) 564 564 { 565 565 struct mfs_superblock *sb; 566 int rc;566 errno_t rc; 567 567 568 568 sb = malloc(MFS_SUPERBLOCK_SIZE);; … … 594 594 * @return EOK on success or an error code. 595 595 */ 596 static int write_superblock3(const struct mfs_sb_info *sbi)596 static errno_t write_superblock3(const struct mfs_sb_info *sbi) 597 597 { 598 598 struct mfs3_superblock *sb; 599 int rc;599 errno_t rc; 600 600 601 601 sb = malloc(MFS_SUPERBLOCK_SIZE); … … 627 627 * @return EOK on success or an error code. 628 628 */ 629 static int init_bitmaps(const struct mfs_sb_info *sb)629 static errno_t init_bitmaps(const struct mfs_sb_info *sb) 630 630 { 631 631 uint32_t *ibmap_buf, *zbmap_buf; … … 634 634 const unsigned int zbmap_nblocks = sb->zbmap_blocks; 635 635 unsigned int i; 636 int rc = EOK;636 errno_t rc = EOK; 637 637 638 638 ibmap_buf = malloc(ibmap_nblocks * sb->block_size); … … 701 701 * @return EOK on success or a error number. 702 702 */ 703 static inline int write_block(aoff64_t off, size_t size, const void *data)703 static inline errno_t write_block(aoff64_t off, size_t size, const void *data) 704 704 { 705 705 if (shift == 3) { 706 int rc;706 errno_t rc; 707 707 aoff64_t tmp_off = off << 1; 708 708 uint8_t *data_ptr = (uint8_t *) data;
Note:
See TracChangeset
for help on using the changeset viewer.