Changeset 24df3834 in mainline for uspace/srv/fs/mfs/mfs_ops.c
- Timestamp:
- 2011-12-08T11:09:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 190c943
- Parents:
- 2f016df (diff), e895352 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_ops.c
r2f016df r24df3834 664 664 struct mfs_node *child = cfn->data; 665 665 struct mfs_sb_info *sbi = parent->instance->sbi; 666 bool destroy_dentry = false; 666 667 667 668 mfsdebug("%s()\n", __FUNCTION__); … … 672 673 int r = mfs_insert_dentry(parent, name, child->ino_i->index); 673 674 if (r != EOK) 674 goto exit_error; 675 676 child->ino_i->i_nlinks++; 677 child->ino_i->dirty = true; 675 return r; 678 676 679 677 if (S_ISDIR(child->ino_i->i_mode)) { 678 if (child->ino_i->i_nlinks != 1) { 679 /* It's not possible to hardlink directories in MFS */ 680 destroy_dentry = true; 681 r = EMLINK; 682 goto exit; 683 } 680 684 r = mfs_insert_dentry(child, ".", child->ino_i->index); 681 if (r != EOK) 682 goto exit_error; 685 if (r != EOK) { 686 destroy_dentry = true; 687 goto exit; 688 } 683 689 684 690 r = mfs_insert_dentry(child, "..", parent->ino_i->index); 685 if (r != EOK) 686 goto exit_error; 691 if (r != EOK) { 692 destroy_dentry = true; 693 goto exit; 694 } 687 695 688 696 parent->ino_i->i_nlinks++; … … 690 698 } 691 699 692 exit_error: 700 exit: 701 if (destroy_dentry) { 702 int r2 = mfs_remove_dentry(parent, name); 703 if (r2 != EOK) 704 r = r2; 705 } else { 706 child->ino_i->i_nlinks++; 707 child->ino_i->dirty = true; 708 } 693 709 return r; 694 710 } … … 821 837 found: 822 838 async_data_read_finalize(callid, d_info.d_name, 823 839 str_size(d_info.d_name) + 1); 824 840 bytes = ((pos - spos) + 1); 825 841 } else {
Note:
See TracChangeset
for help on using the changeset viewer.