Changeset 48902fa in mainline
- Timestamp:
 - 2011-11-11T19:37:46Z (14 years ago)
 - Branches:
 - lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
 - Children:
 - c2e50d7
 - Parents:
 - 20a3465
 - File:
 - 
      
- 1 edited
 
- 
          
  uspace/srv/fs/mfs/mfs_ops.c (modified) (3 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/srv/fs/mfs/mfs_ops.c
r20a3465 r48902fa 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 }  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  