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