Changes in uspace/srv/fs/mfs/mfs_ops.c [c2e50d7:4c3ad56] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_ops.c
rc2e50d7 r4c3ad56 664 664 struct mfs_node *child = cfn->data; 665 665 struct mfs_sb_info *sbi = parent->instance->sbi; 666 bool destroy_dentry = false;667 666 668 667 mfsdebug("%s()\n", __FUNCTION__); … … 673 672 int r = mfs_insert_dentry(parent, name, child->ino_i->index); 674 673 if (r != EOK) 675 return r; 674 goto exit_error; 675 676 child->ino_i->i_nlinks++; 677 child->ino_i->dirty = true; 676 678 677 679 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 }684 680 r = mfs_insert_dentry(child, ".", child->ino_i->index); 685 if (r != EOK) { 686 destroy_dentry = true; 687 goto exit; 688 } 681 if (r != EOK) 682 goto exit_error; 689 683 690 684 r = mfs_insert_dentry(child, "..", parent->ino_i->index); 691 if (r != EOK) { 692 destroy_dentry = true; 693 goto exit; 694 } 685 if (r != EOK) 686 goto exit_error; 695 687 696 688 parent->ino_i->i_nlinks++; … … 698 690 } 699 691 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 } 692 exit_error: 709 693 return r; 710 694 } … … 837 821 found: 838 822 async_data_read_finalize(callid, d_info.d_name, 839 823 str_size(d_info.d_name) + 1); 840 824 bytes = ((pos - spos) + 1); 841 825 } else {
Note:
See TracChangeset
for help on using the changeset viewer.