Changes in uspace/srv/fs/mfs/mfs_ops.c [5930e3f:1ba6651] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_ops.c
r5930e3f r1ba6651 64 64 static int mfs_check_sanity(struct mfs_sb_info *sbi); 65 65 static bool is_power_of_two(uint32_t n); 66 static long mfs_size_block(service_id_t service_id);67 66 68 67 static hash_table_t open_nodes; … … 85 84 .destroy = mfs_destroy_node, 86 85 .has_children = mfs_has_children, 87 .lnkcnt_get = mfs_lnkcnt_get, 88 .size_block = mfs_size_block 86 .lnkcnt_get = mfs_lnkcnt_get 89 87 }; 90 88 91 89 /* Hash table interface for open nodes hash table */ 92 93 90 typedef struct { 94 91 service_id_t service_id; … … 192 189 /* This is a V1 or V2 Minix filesystem */ 193 190 magic = sb->s_magic; 194 } else if (check_magic_number(sb3->s_magic, &native, &version, &longnames)) { 191 } else if (check_magic_number(sb3->s_magic, &native, 192 &version, &longnames)) { 195 193 /* This is a V3 Minix filesystem */ 196 194 magic = sb3->s_magic; … … 347 345 uint32_t inum; 348 346 349 mfsdebug("%s()\n", __FUNCTION__);350 351 347 r = mfs_instance_get(service_id, &inst); 352 348 if (r != EOK) … … 381 377 ino_i->i_mode = S_IFDIR; 382 378 ino_i->i_nlinks = 1; /* This accounts for the '.' dentry */ 383 } else 379 } else { 384 380 ino_i->i_mode = S_IFREG; 381 ino_i->i_nlinks = 0; 382 } 385 383 386 384 ino_i->i_uid = 0; … … 421 419 free(ino_i); 422 420 out_err: 421 mfs_free_inode(inst, inum); 423 422 return r; 424 423 } … … 431 430 struct mfs_dentry_info d_info; 432 431 int r; 433 434 mfsdebug("%s()\n", __FUNCTION__);435 432 436 433 if (!S_ISDIR(ino_i->i_mode)) … … 480 477 struct mfs_instance *instance; 481 478 482 mfsdebug("%s()\n", __FUNCTION__);483 484 479 rc = mfs_instance_get(service_id, &instance); 485 480 if (rc != EOK) … … 494 489 int rc = EOK; 495 490 struct mfs_node *mnode = fsnode->data; 496 497 mfsdebug("%s()\n", __FUNCTION__);498 491 499 492 fibril_mutex_lock(&open_nodes_lock); … … 556 549 int rc; 557 550 558 mfsdebug("%s()\n", __FUNCTION__);559 560 551 fibril_mutex_lock(&open_nodes_lock); 561 552 … … 570 561 if (already_open) { 571 562 mnode = hash_table_get_inst(already_open, struct mfs_node, link); 563 572 564 *rfn = mnode->fsnode; 573 565 mnode->refcnt++; … … 651 643 bool destroy_dentry = false; 652 644 653 mfsdebug("%s()\n", __FUNCTION__);654 655 645 if (str_size(name) > sbi->max_name_len) 656 646 return ENAMETOOLONG; … … 675 665 r = mfs_insert_dentry(child, "..", parent->ino_i->index); 676 666 if (r != EOK) { 667 mfs_remove_dentry(child, "."); 677 668 destroy_dentry = true; 678 669 goto exit; … … 702 693 bool has_children; 703 694 int r; 704 705 mfsdebug("%s()\n", __FUNCTION__);706 695 707 696 if (!parent) … … 926 915 927 916 r = mfs_write_map(mnode, pos, block, &dummy); 928 if (r != EOK) 917 if (r != EOK) { 918 mfs_free_zone(mnode->instance, block); 929 919 goto out_err; 920 } 930 921 931 922 flags = BLOCK_FLAGS_NOREAD; … … 967 958 mfs_destroy(service_id_t service_id, fs_index_t index) 968 959 { 969 fs_node_t *fn ;960 fs_node_t *fn = NULL; 970 961 int r; 971 962 … … 1138 1129 } 1139 1130 1140 static long1141 mfs_size_block(service_id_t service_id)1142 {1143 long block_size;1144 1145 struct mfs_instance *inst;1146 int rc = mfs_instance_get(service_id, &inst);1147 if (rc != EOK)1148 return rc;1149 if (NULL == inst)1150 return ENOENT;1151 block_size = inst->sbi->block_size;1152 return block_size;1153 }1154 1155 1131 vfs_out_ops_t mfs_ops = { 1156 1132 .mounted = mfs_mounted,
Note:
See TracChangeset
for help on using the changeset viewer.