Changes in / [3908355:c8bb1633] in mainline
- Location:
- uspace/srv/fs/mfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_balloc.c
r3908355 rc8bb1633 128 128 start_block = 2 + sbi->ibmap_blocks; 129 129 if (idx > sbi->nzones) { 130 printf(NAME ": Error! Trying to free beyond the "130 printf(NAME ": Error! Trying to free beyond the" \ 131 131 "bitmap max size\n"); 132 132 return -1; … … 137 137 start_block = 2; 138 138 if (idx > sbi->ninodes) { 139 printf(NAME ": Error! Trying to free beyond the "139 printf(NAME ": Error! Trying to free beyond the" \ 140 140 "bitmap max size\n"); 141 141 return -1; … … 202 202 start_block = 2; 203 203 nblocks = sbi->ibmap_blocks; 204 limit = sbi->ninodes - 1;204 limit = sbi->ninodes; 205 205 } 206 206 bits_per_block = sbi->block_size * 8; -
uspace/srv/fs/mfs/mfs_dentry.c
r3908355 rc8bb1633 36 36 * 37 37 * @param mnode Pointer to the directory node. 38 * @param d_info Pointer to a directory entry structure where 39 * the dentry infowill be stored.38 * @param d_info Pointer to a directory entry structure where the dentry info 39 * will be stored. 40 40 * @param index index of the dentry in the list. 41 41 * … … 101 101 /**Write a directory entry on disk. 102 102 * 103 * @param d_info The directory entry to write todisk.103 * @param d_info Pointer to the directory entry structure to write on disk. 104 104 * 105 105 * @return EOK on success or a negative error code. … … 240 240 goto out; 241 241 r = mfs_write_map(mnode, pos, b, &dummy); 242 if (r != EOK) { 243 mfs_free_zone(mnode->instance, b); 242 if (r != EOK) 244 243 goto out; 245 }246 244 } 247 245 -
uspace/srv/fs/mfs/mfs_ops.c
r3908355 rc8bb1633 88 88 89 89 /* Hash table interface for open nodes hash table */ 90 90 91 typedef struct { 91 92 service_id_t service_id; … … 189 190 /* This is a V1 or V2 Minix filesystem */ 190 191 magic = sb->s_magic; 191 } else if (check_magic_number(sb3->s_magic, &native, 192 &version, &longnames)) { 192 } else if (check_magic_number(sb3->s_magic, &native, &version, &longnames)) { 193 193 /* This is a V3 Minix filesystem */ 194 194 magic = sb3->s_magic; … … 345 345 uint32_t inum; 346 346 347 mfsdebug("%s()\n", __FUNCTION__); 348 347 349 r = mfs_instance_get(service_id, &inst); 348 350 if (r != EOK) … … 377 379 ino_i->i_mode = S_IFDIR; 378 380 ino_i->i_nlinks = 1; /* This accounts for the '.' dentry */ 379 } else {381 } else 380 382 ino_i->i_mode = S_IFREG; 381 ino_i->i_nlinks = 0;382 }383 383 384 384 ino_i->i_uid = 0; … … 419 419 free(ino_i); 420 420 out_err: 421 mfs_free_inode(inst, inum);422 421 return r; 423 422 } … … 430 429 struct mfs_dentry_info d_info; 431 430 int r; 431 432 mfsdebug("%s()\n", __FUNCTION__); 432 433 433 434 if (!S_ISDIR(ino_i->i_mode)) … … 477 478 struct mfs_instance *instance; 478 479 480 mfsdebug("%s()\n", __FUNCTION__); 481 479 482 rc = mfs_instance_get(service_id, &instance); 480 483 if (rc != EOK) … … 489 492 int rc = EOK; 490 493 struct mfs_node *mnode = fsnode->data; 494 495 mfsdebug("%s()\n", __FUNCTION__); 491 496 492 497 fibril_mutex_lock(&open_nodes_lock); … … 549 554 int rc; 550 555 556 mfsdebug("%s()\n", __FUNCTION__); 557 551 558 fibril_mutex_lock(&open_nodes_lock); 552 559 … … 561 568 if (already_open) { 562 569 mnode = hash_table_get_inst(already_open, struct mfs_node, link); 563 564 570 *rfn = mnode->fsnode; 565 571 mnode->refcnt++; … … 642 648 struct mfs_sb_info *sbi = parent->instance->sbi; 643 649 bool destroy_dentry = false; 650 651 mfsdebug("%s()\n", __FUNCTION__); 644 652 645 653 if (str_size(name) > sbi->max_name_len) … … 665 673 r = mfs_insert_dentry(child, "..", parent->ino_i->index); 666 674 if (r != EOK) { 667 mfs_remove_dentry(child, ".");668 675 destroy_dentry = true; 669 676 goto exit; … … 693 700 bool has_children; 694 701 int r; 702 703 mfsdebug("%s()\n", __FUNCTION__); 695 704 696 705 if (!parent) … … 915 924 916 925 r = mfs_write_map(mnode, pos, block, &dummy); 917 if (r != EOK) { 918 mfs_free_zone(mnode->instance, block); 926 if (r != EOK) 919 927 goto out_err; 920 }921 928 922 929 flags = BLOCK_FLAGS_NOREAD; … … 958 965 mfs_destroy(service_id_t service_id, fs_index_t index) 959 966 { 960 fs_node_t *fn = NULL;967 fs_node_t *fn; 961 968 int r; 962 969
Note:
See TracChangeset
for help on using the changeset viewer.