Changes in / [747ef72:54464f6a] in mainline
- Location:
- uspace
- Files:
-
- 10 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_balloc.c
r747ef72 r54464f6a 198 198 limit = sbi->nzones - sbi->firstdatazone - 1; 199 199 } else { 200 /* bid == BMAP_INODE*/200 /* bid == BMAP_INODE */ 201 201 search = &sbi->isearch; 202 202 start_block = 2; … … 212 212 for (i = *search / bits_per_block; i < nblocks; ++i) { 213 213 r = block_get(&b, inst->service_id, i + start_block, 214 214 BLOCK_FLAGS_NONE); 215 215 216 216 if (r != EOK) -
uspace/srv/fs/mfs/mfs_dentry.c
r747ef72 r54464f6a 168 168 return ENAMETOOLONG; 169 169 170 /* Search the directory entry to be removed*/170 /* Search the directory entry to be removed */ 171 171 unsigned i; 172 172 for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize ; ++i) { -
uspace/srv/fs/mfs/mfs_inode.c
r747ef72 r54464f6a 235 235 236 236 r = block_get(&b, mnode->instance->service_id, 237 238 237 itable_off + inum / sbi->ino_per_block, 238 BLOCK_FLAGS_NONE); 239 239 240 240 if (r != EOK) … … 278 278 279 279 r = block_get(&b, mnode->instance->service_id, 280 281 280 itable_off + inum / sbi->ino_per_block, 281 BLOCK_FLAGS_NONE); 282 282 283 283 if (r != EOK) -
uspace/srv/fs/mfs/mfs_ops.c
r747ef72 r54464f6a 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.