Changeset c699b0c in mainline for uspace/srv/fs/minixfs/mfs_ops.c
- Timestamp:
- 2011-09-04T13:12:33Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a5ee6c
- Parents:
- 03bc76a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_ops.c
r03bc76a rc699b0c 335 335 336 336 r = mfs_instance_get(service_id, &inst); 337 on_error(r, return r); 337 if (r != EOK) 338 return r; 338 339 339 340 /*Alloc a new inode*/ 340 341 r = mfs_alloc_inode(inst, &inum); 341 on_error(r, return r); 342 if (r != EOK) 343 return r; 342 344 343 345 struct mfs_ino_info *ino_i; … … 432 434 for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize; ++i) { 433 435 r = read_dentry(mnode, &d_info, i); 434 on_error(r, return r); 436 if (r != EOK) 437 return r; 435 438 436 439 if (!d_info.d_inum) { … … 475 478 476 479 rc = mfs_instance_get(service_id, &instance); 477 on_error(rc, return rc); 480 if (rc != EOK) 481 return rc; 478 482 479 483 return mfs_node_core_get(rfn, instance, index); … … 583 587 584 588 rc = get_inode(inst, &ino_i, index); 585 on_error(rc, goto out_err); 589 if (rc != EOK) 590 goto out_err; 586 591 587 592 ino_i->index = index; … … 641 646 642 647 int r = insert_dentry(parent, name, child->ino_i->index); 643 on_error(r, goto exit_error); 648 if (r != EOK) 649 goto exit_error; 644 650 645 651 if (S_ISDIR(child->ino_i->i_mode)) { 646 652 r = insert_dentry(child, ".", child->ino_i->index); 647 on_error(r, goto exit_error); 653 if (r != EOK) 654 goto exit_error; 648 655 //child->ino_i->i_nlinks++; 649 656 //child->ino_i->dirty = true; 650 657 r = insert_dentry(child, "..", parent->ino_i->index); 651 on_error(r, goto exit_error); 658 if (r != EOK) 659 goto exit_error; 652 660 //parent->ino_i->i_nlinks++; 653 661 //parent->ino_i->dirty = true; … … 672 680 673 681 r = mfs_has_children(&has_children, cfn); 674 on_error(r, return r); 682 if (r != EOK) 683 return r; 675 684 676 685 if (has_children) … … 678 687 679 688 r = remove_dentry(parent, name); 680 on_error(r, return r); 689 if (r != EOK) 690 return r; 681 691 682 692 struct mfs_ino_info *chino = child->ino_i; … … 713 723 for (i = 2; i < mnode->ino_i->i_size / sbi->dirsize; ++i) { 714 724 r = read_dentry(mnode, &d_info, i); 715 on_error(r, return r); 725 if (r != EOK) 726 return r; 716 727 717 728 if (d_info.d_inum) { … … 764 775 for (; pos < mnode->ino_i->i_size / sbi->dirsize; ++pos) { 765 776 rc = read_dentry(mnode, &d_info, pos); 766 on_error(rc, goto out_error); 777 if (rc != EOK) 778 goto out_error; 767 779 768 780 if (d_info.d_inum) { … … 796 808 797 809 rc = read_map(&zone, mnode, pos); 798 on_error(rc, goto out_error); 810 if (rc != EOK) 811 goto out_error; 799 812 800 813 if (zone == 0) { … … 813 826 814 827 rc = block_get(&b, service_id, zone, BLOCK_FLAGS_NONE); 815 on_error(rc, goto out_error); 828 if (rc != EOK) 829 goto out_error; 816 830 817 831 async_data_read_finalize(callid, b->data + … … 870 884 if (pos < boundary) { 871 885 r = read_map(&block, mnode, pos); 872 on_error(r, goto out_err); 886 if (r != EOK) 887 goto out_err; 873 888 874 889 if (block == 0) { 875 890 /*Writing in a sparse block*/ 876 891 r = mfs_alloc_zone(mnode->instance, &block); 877 on_error(r, goto out_err); 892 if (r != EOK) 893 goto out_err; 878 894 flags = BLOCK_FLAGS_NOREAD; 879 895 } … … 882 898 883 899 r = mfs_alloc_zone(mnode->instance, &block); 884 on_error(r, goto out_err); 900 if (r != EOK) 901 goto out_err; 885 902 886 903 r = write_map(mnode, pos, block, &dummy); 887 on_error(r, goto out_err); 904 if (r != EOK) 905 goto out_err; 888 906 } 889 907 890 908 block_t *b; 891 909 r = block_get(&b, service_id, block, flags); 892 on_error(r, goto out_err); 910 if (r != EOK) 911 goto out_err; 893 912 894 913 async_data_write_finalize(callid, b->data + pos % bs, bytes); … … 941 960 942 961 r = mfs_has_children(&has_children, fn); 943 on_error(r, goto out); 962 if (r != EOK) 963 goto out; 944 964 945 965 assert(!has_children); … … 953 973 /*Free the entire inode content*/ 954 974 r = inode_shrink(mnode, mnode->ino_i->i_size); 955 on_error(r, goto out); 975 if (r != EOK) 976 goto out; 956 977 r = mfs_free_inode(mnode->instance, mnode->ino_i->index); 957 978
Note:
See TracChangeset
for help on using the changeset viewer.