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