Changes in uspace/app/mkmfs/mkmfs.c [04efacc:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkmfs/mkmfs.c
r04efacc 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, c, opt_ind; 111 errno_t rc; 112 int c, opt_ind; 112 113 char *device_name; 113 114 size_t devblock_size; … … 289 290 * @param sb Pointer to the superblock structure. 290 291 * 291 * @return EOK on success or a negativeerror code.292 */ 293 static int insert_dentries(const struct mfs_sb_info *sb)292 * @return EOK on success or an error code. 293 */ 294 static errno_t insert_dentries(const struct mfs_sb_info *sb) 294 295 { 295 296 void *root_block; 296 297 uint8_t *dentry_ptr; 297 int rc;298 errno_t rc; 298 299 const long root_dblock = sb->first_data_zone; 299 300 … … 342 343 * @param sb Pointer to the superblock structure. 343 344 * 344 * @return EOK on success or a negativeerror code.345 */ 346 static int init_inode_table(const struct mfs_sb_info *sb)345 * @return EOK on success or an error code. 346 */ 347 static errno_t init_inode_table(const struct mfs_sb_info *sb) 347 348 { 348 349 unsigned int i; 349 350 uint8_t *itable_buf; 350 int rc = EOK;351 errno_t rc = EOK; 351 352 352 353 long itable_off = sb->zbmap_blocks + sb->ibmap_blocks + 2; … … 375 376 * @param sb Ponter to the superblock structure. 376 377 * 377 * @return EOK on success or a negativeerror code.378 */ 379 static int make_root_ino(const struct mfs_sb_info *sb)378 * @return EOK on success or an error code. 379 */ 380 static errno_t make_root_ino(const struct mfs_sb_info *sb) 380 381 { 381 382 struct mfs_inode *ino_buf; 382 int rc;383 errno_t rc; 383 384 384 385 const long itable_off = sb->zbmap_blocks + sb->ibmap_blocks + 2; … … 412 413 * @param sb Pointer to the superblock structure. 413 414 * 414 * @return EOK on success or a negativeerror code.415 */ 416 static int make_root_ino2(const struct mfs_sb_info *sb)415 * @return EOK on success or an error code. 416 */ 417 static errno_t make_root_ino2(const struct mfs_sb_info *sb) 417 418 { 418 419 struct mfs2_inode *ino_buf; 419 int rc;420 errno_t rc; 420 421 421 422 /* Compute offset of the first inode table block */ … … 451 452 * @param sb Pointer to the superblock structure. 452 453 * 453 * @return EOK on success or a negativeerror code.454 */ 455 static int init_superblock(struct mfs_sb_info *sb)454 * @return EOK on success or an error code. 455 */ 456 static errno_t init_superblock(struct mfs_sb_info *sb) 456 457 { 457 458 aoff64_t inodes; … … 459 460 unsigned long ind2; 460 461 unsigned long zones; 461 int rc;462 errno_t rc; 462 463 463 464 if (sb->longnames) … … 558 559 * @param sbi Pointer to the superblock structure to write on disk. 559 560 * 560 * @return EOK on success or a negativeerror code.561 */ 562 static int write_superblock(const struct mfs_sb_info *sbi)561 * @return EOK on success or an error code. 562 */ 563 static errno_t write_superblock(const struct mfs_sb_info *sbi) 563 564 { 564 565 struct mfs_superblock *sb; 565 int rc;566 errno_t rc; 566 567 567 568 sb = malloc(MFS_SUPERBLOCK_SIZE);; … … 591 592 * @param sbi Pointer to the superblock structure to write on disk. 592 593 * 593 * @return EOK on success or a negativeerror code.594 */ 595 static int write_superblock3(const struct mfs_sb_info *sbi)594 * @return EOK on success or an error code. 595 */ 596 static errno_t write_superblock3(const struct mfs_sb_info *sbi) 596 597 { 597 598 struct mfs3_superblock *sb; 598 int rc;599 errno_t rc; 599 600 600 601 sb = malloc(MFS_SUPERBLOCK_SIZE); … … 624 625 * @param sb Pointer to the superblock structure. 625 626 * 626 * @return EOK on success or a negativeerror code.627 */ 628 static int init_bitmaps(const struct mfs_sb_info *sb)627 * @return EOK on success or an error code. 628 */ 629 static errno_t init_bitmaps(const struct mfs_sb_info *sb) 629 630 { 630 631 uint32_t *ibmap_buf, *zbmap_buf; … … 633 634 const unsigned int zbmap_nblocks = sb->zbmap_blocks; 634 635 unsigned int i; 635 int rc = EOK;636 errno_t rc = EOK; 636 637 637 638 ibmap_buf = malloc(ibmap_nblocks * sb->block_size); … … 698 699 * @param data Pointer to the block content. 699 700 * 700 * @return EOK on success or a negativeerror number.701 */ 702 static inline int write_block(aoff64_t off, size_t size, const void *data)701 * @return EOK on success or a error number. 702 */ 703 static inline errno_t write_block(aoff64_t off, size_t size, const void *data) 703 704 { 704 705 if (shift == 3) { 705 int rc;706 errno_t rc; 706 707 aoff64_t tmp_off = off << 1; 707 708 uint8_t *data_ptr = (uint8_t *) data;
Note:
See TracChangeset
for help on using the changeset viewer.