Changeset bbd4c72 in mainline
- Timestamp:
- 2011-09-05T18:16:45Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 75e0f15
- Parents:
- 3a5ee6c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_ops.c
r3a5ee6c rbbd4c72 161 161 162 162 /* initialize libblock */ 163 rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);163 rc = block_init(EXCHANGE_SERIALIZE, service_id, 4096); 164 164 if (rc != EOK) 165 165 return rc; … … 175 175 instance = malloc(sizeof(*instance)); 176 176 if (!instance) { 177 free(sbi); 177 178 block_fini(service_id); 178 179 return ENOMEM; … … 307 308 struct mfs_instance *inst; 308 309 310 mfsdebug("%s()\n", __FUNCTION__); 311 309 312 int r = mfs_instance_get(service_id, &inst); 310 313 if (r != EOK) … … 372 375 } 373 376 374 if (flags & L_DIRECTORY) 377 if (flags & L_DIRECTORY) { 375 378 ino_i->i_mode = S_IFDIR; 376 else 379 ino_i->i_nlinks = 2; /*This accounts for the '.' dentry*/ 380 } else { 377 381 ino_i->i_mode = S_IFREG; 378 379 ino_i->i_nlinks = 1; 382 ino_i->i_nlinks = 1; 383 } 384 380 385 ino_i->i_uid = 0; 381 386 ino_i->i_gid = 0; … … 546 551 mfsdebug("%s()\n", __FUNCTION__); 547 552 548 assert(mnode); 549 assert(mnode->ino_i); 553 if (S_ISDIR(mnode->ino_i->i_mode)) { 554 if (mnode->ino_i->i_nlinks > 1) 555 return 1; 556 else 557 return 0; 558 } 550 559 551 560 return mnode->ino_i->i_nlinks; … … 662 671 if (r != EOK) 663 672 goto exit_error; 664 //child->ino_i->i_nlinks++; 665 //child->ino_i->dirty = true; 673 666 674 r = mfs_insert_dentry(child, "..", parent->ino_i->index); 667 675 if (r != EOK) 668 676 goto exit_error; 669 //parent->ino_i->i_nlinks++; 670 //parent->ino_i->dirty = true; 677 678 parent->ino_i->i_nlinks++; 679 parent->ino_i->dirty = true; 671 680 } 672 681 … … 702 711 703 712 assert(chino->i_nlinks >= 1); 704 --chino->i_nlinks; 705 /* 706 if (chino->i_nlinks == 0 && S_ISDIR(chino->i_mode)) { 713 chino->i_nlinks--; 714 mfsdebug("Links: %d\n", chino->i_nlinks); 715 716 if (chino->i_nlinks <= 1 && S_ISDIR(chino->i_mode)) { 717 /* The child directory will be destroyed, decrease the 718 * parent hard links counter. 719 */ 707 720 parent->ino_i->i_nlinks--; 708 721 parent->ino_i->dirty = true; 709 722 } 710 */711 723 712 724 chino->dirty = true;
Note:
See TracChangeset
for help on using the changeset viewer.