Changeset 6d4d883 in mainline
- Timestamp:
- 2011-10-14T19:39:02Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2ac7af3
- Parents:
- 9269c88
- Location:
- uspace/srv/fs/mfs
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs.c
r9269c88 r6d4d883 74 74 75 75 async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE, 76 76 SERVICE_VFS, 0, 0); 77 77 78 78 if (!vfs_sess) { -
uspace/srv/fs/mfs/mfs_balloc.c
r9269c88 r6d4d883 36 36 static int 37 37 find_free_bit_and_set(bitchunk_t *b, const int bsize, 38 38 const bool native, unsigned start_bit); 39 39 40 40 static int … … 129 129 if (idx > sbi->nzones) { 130 130 printf(NAME ": Error! Trying to free beyond the" \ 131 131 "bitmap max size\n"); 132 132 return -1; 133 133 } 134 134 } else { 135 /* bid == BMAP_INODE*/135 /* bid == BMAP_INODE */ 136 136 search = &sbi->isearch; 137 137 start_block = 2; 138 138 if (idx > sbi->ninodes) { 139 139 printf(NAME ": Error! Trying to free beyond the" \ 140 140 "bitmap max size\n"); 141 141 return -1; 142 142 } 143 143 } 144 144 145 /* Compute the bitmap block*/145 /* Compute the bitmap block */ 146 146 uint32_t block = idx / (sbi->block_size * 8) + start_block; 147 147 … … 150 150 goto out_err; 151 151 152 /* Compute the bit index in the block*/152 /* Compute the bit index in the block */ 153 153 idx %= (sbi->block_size * 8); 154 154 bitchunk_t *ptr = b->data; … … 220 220 221 221 freebit = find_free_bit_and_set(b->data, sbi->block_size, 222 222 sbi->native, tmp); 223 223 if (freebit == -1) { 224 /* No free bit in this block*/224 /* No free bit in this block */ 225 225 r = block_put(b); 226 226 if (r != EOK) … … 229 229 } 230 230 231 /* Free bit found in this block, compute the real index*/231 /* Free bit found in this block, compute the real index */ 232 232 *idx = freebit + bits_per_block * i; 233 233 if (*idx > limit) { 234 /* Index is beyond the limit, it is invalid*/234 /* Index is beyond the limit, it is invalid */ 235 235 r = block_put(b); 236 236 if (r != EOK) … … 246 246 247 247 if (*search > 0) { 248 /* Repeat the search from the first bitmap block*/248 /* Repeat the search from the first bitmap block */ 249 249 *search = 0; 250 250 goto retry; 251 251 } 252 252 253 /* Free bit not found, return error*/253 /* Free bit not found, return error */ 254 254 return ENOSPC; 255 255 … … 260 260 static int 261 261 find_free_bit_and_set(bitchunk_t *b, const int bsize, 262 262 const bool native, unsigned start_bit) 263 263 { 264 264 int r = -1; … … 268 268 269 269 for (i = start_bit / chunk_bits; 270 i < bsize / sizeof(bitchunk_t); ++i) { 270 i < bsize / sizeof(bitchunk_t); ++i) { 271 271 272 if (!(~b[i])) { 272 /* No free bit in this chunk*/273 /* No free bit in this chunk */ 273 274 continue; 274 275 } -
uspace/srv/fs/mfs/mfs_dentry.c
r9269c88 r6d4d883 44 44 int 45 45 mfs_read_dentry(struct mfs_node *mnode, 46 46 struct mfs_dentry_info *d_info, unsigned index) 47 47 { 48 48 const struct mfs_instance *inst = mnode->instance; … … 57 57 58 58 if (block == 0) { 59 /* End of the dentries list*/59 /* End of the dentries list */ 60 60 r = EOK; 61 61 goto out_err; … … 79 79 } else { 80 80 const int namelen = longnames ? MFS_L_MAX_NAME_LEN : 81 81 MFS_MAX_NAME_LEN; 82 82 83 83 struct mfs_dentry *d; 84 84 85 85 d = b->data + dentry_off * (longnames ? MFSL_DIRSIZE : 86 86 MFS_DIRSIZE); 87 87 d_info->d_inum = conv16(sbi->native, d->d_inum); 88 88 memcpy(d_info->d_name, d->d_name, namelen); … … 101 101 /**Write a directory entry on disk. 102 102 * 103 * @param d_info 104 * 105 * @return 103 * @param d_info Pointer to the directory entry structure to write on disk. 104 * 105 * @return EOK on success or a negative error code. 106 106 */ 107 107 int … … 178 178 179 179 if (name_len == d_name_len && 180 !bcmp(d_info.d_name, d_name, name_len)) { 180 !bcmp(d_info.d_name, d_name, name_len)) { 181 181 182 d_info.d_inum = 0; 182 183 r = mfs_write_dentry(&d_info); … … 197 198 */ 198 199 int 199 mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum) 200 mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, 201 fs_index_t d_inum) 200 202 { 201 203 int r; … … 209 211 return ENAMETOOLONG; 210 212 211 /* Search for an empty dentry*/213 /* Search for an empty dentry */ 212 214 unsigned i; 213 215 for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize; ++i) { … … 217 219 218 220 if (d_info.d_inum == 0) { 219 /* This entry is not used*/221 /* This entry is not used */ 220 222 empty_dentry_found = true; 221 223 break; … … 231 233 232 234 if (b == 0) { 233 /* Increase the inode size*/235 /* Increase the inode size */ 234 236 235 237 uint32_t dummy; -
uspace/srv/fs/mfs/mfs_inode.c
r9269c88 r6d4d883 42 42 static int 43 43 mfs_read_inode_raw(const struct mfs_instance *instance, 44 44 struct mfs_ino_info **ino_ptr, uint16_t inum); 45 45 46 46 static int 47 47 mfs2_read_inode_raw(const struct mfs_instance *instance, 48 48 struct mfs_ino_info **ino_ptr, uint32_t inum); 49 49 50 50 /**Read a MINIX inode from disk … … 59 59 int 60 60 mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i, 61 61 fs_index_t index) 62 62 { 63 63 struct mfs_sb_info *sbi = inst->sbi; … … 65 65 66 66 if (sbi->fs_version == MFS_VERSION_V1) { 67 /* Read a MFS V1 inode*/67 /* Read a MFS V1 inode */ 68 68 r = mfs_read_inode_raw(inst, ino_i, index); 69 69 } else { 70 /* Read a MFS V2/V3 inode*/70 /* Read a MFS V2/V3 inode */ 71 71 r = mfs2_read_inode_raw(inst, ino_i, index); 72 72 } … … 77 77 static int 78 78 mfs_read_inode_raw(const struct mfs_instance *instance, 79 struct mfs_ino_info **ino_ptr, uint16_t inum) { 79 struct mfs_ino_info **ino_ptr, uint16_t inum) 80 { 80 81 struct mfs_inode *ino; 81 82 struct mfs_ino_info *ino_i = NULL; … … 86 87 sbi = instance->sbi; 87 88 88 /* inode 0 does not exist*/89 /* inode 0 does not exist */ 89 90 inum -= 1; 90 91 … … 101 102 102 103 r = block_get(&b, instance->service_id, 103 itable_off + inum / sbi->ino_per_block, 104 BLOCK_FLAGS_NONE); 104 itable_off + inum / sbi->ino_per_block, 105 BLOCK_FLAGS_NONE); 106 105 107 if (r != EOK) 106 108 goto out_err; … … 134 136 static int 135 137 mfs2_read_inode_raw(const struct mfs_instance *instance, 136 struct mfs_ino_info **ino_ptr, uint32_t inum) { 138 struct mfs_ino_info **ino_ptr, uint32_t inum) 139 { 137 140 struct mfs2_inode *ino; 138 141 struct mfs_ino_info *ino_i = NULL; … … 150 153 sbi = instance->sbi; 151 154 152 /* inode 0 does not exist*/155 /* inode 0 does not exist */ 153 156 inum -= 1; 154 157 … … 157 160 158 161 r = block_get(&b, instance->service_id, 159 itable_off + inum / sbi->ino_per_block, 160 BLOCK_FLAGS_NONE); 162 itable_off + inum / sbi->ino_per_block, 163 BLOCK_FLAGS_NONE); 164 161 165 if (r != EOK) 162 166 goto out_err; … … 322 326 323 327 if (size_shrink == 0) { 324 /* Nothing to be done*/328 /* Nothing to be done */ 325 329 return EOK; 326 330 } … … 333 337 ino_i->dirty = true; 334 338 335 /* Compute the number of zones to free*/339 /* Compute the number of zones to free */ 336 340 unsigned zones_to_free; 337 341 … … 354 358 355 359 if (old_zone == 0) 356 continue; /* Sparse block*/360 continue; /* Sparse block */ 357 361 358 362 r = mfs_free_zone(mnode->instance, old_zone); -
uspace/srv/fs/mfs/mfs_ops.c
r9269c88 r6d4d883 43 43 44 44 static bool check_magic_number(uint16_t magic, bool *native, 45 45 mfs_version_t *version, bool *longfilenames); 46 46 static int mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst, 47 fs_index_t index); 48 47 fs_index_t index); 49 48 static int mfs_node_put(fs_node_t *fsnode); 50 49 static int mfs_node_open(fs_node_t *fsnode); … … 64 63 static hash_index_t open_nodes_hash(unsigned long key[]); 65 64 static int open_nodes_compare(unsigned long key[], hash_count_t keys, 66 65 link_t *item); 67 66 static void open_nodes_remove_cb(link_t *link); 68 69 67 static int mfs_node_get(fs_node_t **rfn, service_id_t service_id, 70 71 static int 72 mfs_instance_get(service_id_t service_id,struct mfs_instance **instance);68 fs_index_t index); 69 static int mfs_instance_get(service_id_t service_id, 70 struct mfs_instance **instance); 73 71 74 72 … … 96 94 97 95 /* Hash table interface for open nodes hash table */ 98 static hash_index_t open_nodes_hash(unsigned long key[]) 96 static hash_index_t 97 open_nodes_hash(unsigned long key[]) 99 98 { 100 99 /* TODO: This is very simple and probably can be improved */ … … 102 101 } 103 102 104 static int open_nodes_compare(unsigned long key[], hash_count_t keys, 105 link_t *item) 103 static int 104 open_nodes_compare(unsigned long key[], hash_count_t keys, 105 link_t *item) 106 106 { 107 107 struct mfs_node *mnode = hash_table_get_instance(item, struct mfs_node, link); … … 118 118 } 119 119 120 static void open_nodes_remove_cb(link_t *link) 120 static void 121 open_nodes_remove_cb(link_t *link) 121 122 { 122 123 /* We don't use remove callback for this hash table */ … … 129 130 }; 130 131 131 int mfs_global_init(void) 132 int 133 mfs_global_init(void) 132 134 { 133 135 if (!hash_table_create(&open_nodes, OPEN_NODES_BUCKETS, 134 136 OPEN_NODES_KEYS, &open_nodes_ops)) { 135 137 return ENOMEM; 136 138 } … … 140 142 static int 141 143 mfs_mounted(service_id_t service_id, const char *opts, fs_index_t *index, 142 144 aoff64_t *size, unsigned *linkcnt) 143 145 { 144 146 enum cache_mode cmode; … … 163 165 return rc; 164 166 165 /* Allocate space for generic MFS superblock*/167 /* Allocate space for generic MFS superblock */ 166 168 sbi = malloc(sizeof(*sbi)); 167 169 if (!sbi) { … … 170 172 } 171 173 172 /* Allocate space for filesystem instance*/174 /* Allocate space for filesystem instance */ 173 175 instance = malloc(sizeof(*instance)); 174 176 if (!instance) { … … 191 193 192 194 if (check_magic_number(sb->s_magic, &native, &version, &longnames)) { 193 /* This is a V1 or V2 Minix filesystem*/195 /* This is a V1 or V2 Minix filesystem */ 194 196 magic = sb->s_magic; 195 197 } else if (check_magic_number(sb3->s_magic, &native, &version, &longnames)) { 196 /* This is a V3 Minix filesystem*/198 /* This is a V3 Minix filesystem */ 197 199 magic = sb3->s_magic; 198 200 } else { 199 /* Not recognized*/201 /* Not recognized */ 200 202 mfsdebug("magic number not recognized\n"); 201 203 rc = ENOTSUP; … … 205 207 mfsdebug("magic number recognized = %04x\n", magic); 206 208 207 /* Fill superblock info structure*/209 /* Fill superblock info structure */ 208 210 209 211 sbi->fs_version = version; … … 243 245 sbi->dirsize = longnames ? MFSL_DIRSIZE : MFS_DIRSIZE; 244 246 sbi->max_name_len = longnames ? MFS_L_MAX_NAME_LEN : 245 247 MFS_MAX_NAME_LEN; 246 248 } 247 249 … … 267 269 } 268 270 269 /* Initialize the instance structure and remember it*/271 /* Initialize the instance structure and remember it */ 270 272 instance->service_id = service_id; 271 273 instance->sbi = sbi; … … 328 330 } 329 331 330 service_id_t mfs_service_get(fs_node_t *fsnode) 332 service_id_t 333 mfs_service_get(fs_node_t *fsnode) 331 334 { 332 335 struct mfs_node *node = fsnode->data; … … 334 337 } 335 338 336 static int mfs_create_node(fs_node_t **rfn, service_id_t service_id, int flags) 339 static int 340 mfs_create_node(fs_node_t **rfn, service_id_t service_id, int flags) 337 341 { 338 342 int r; … … 348 352 return r; 349 353 350 /* Alloc a new inode*/354 /* Alloc a new inode */ 351 355 r = mfs_alloc_inode(inst, &inum); 352 356 if (r != EOK) … … 375 379 if (flags & L_DIRECTORY) { 376 380 ino_i->i_mode = S_IFDIR; 377 ino_i->i_nlinks = 2; /* This accounts for the '.' dentry*/381 ino_i->i_nlinks = 2; /* This accounts for the '.' dentry */ 378 382 } else { 379 383 ino_i->i_mode = S_IFREG; … … 428 432 } 429 433 430 static int mfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component) 434 static int 435 mfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component) 431 436 { 432 437 struct mfs_node *mnode = pfn->data; … … 450 455 451 456 if (!d_info.d_inum) { 452 /* This entry is not used*/457 /* This entry is not used */ 453 458 continue; 454 459 } … … 457 462 458 463 if (comp_size == dentry_name_size && 459 460 /* Hit!*/464 !bcmp(component, d_info.d_name, dentry_name_size)) { 465 /* Hit! */ 461 466 mfs_node_core_get(rfn, mnode->instance, 462 467 d_info.d_inum); 463 468 goto found; 464 469 } … … 469 474 } 470 475 471 static aoff64_t mfs_size_get(fs_node_t *node) 476 static aoff64_t 477 mfs_size_get(fs_node_t *node) 472 478 { 473 479 const struct mfs_node *mnode = node->data; … … 477 483 static int 478 484 mfs_node_get(fs_node_t **rfn, service_id_t service_id, 479 485 fs_index_t index) 480 486 { 481 487 int rc; … … 521 527 } 522 528 523 static int mfs_node_open(fs_node_t *fsnode) 529 static int 530 mfs_node_open(fs_node_t *fsnode) 524 531 { 525 532 /* … … 530 537 } 531 538 532 static fs_index_t mfs_index_get(fs_node_t *fsnode) 539 static fs_index_t 540 mfs_index_get(fs_node_t *fsnode) 533 541 { 534 542 struct mfs_node *mnode = fsnode->data; … … 536 544 } 537 545 538 static unsigned mfs_lnkcnt_get(fs_node_t *fsnode) 546 static unsigned 547 mfs_lnkcnt_get(fs_node_t *fsnode) 539 548 { 540 549 struct mfs_node *mnode = fsnode->data; … … 551 560 } 552 561 553 static int mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst, 554 fs_index_t index) 562 static int 563 mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst, 564 fs_index_t index) 555 565 { 556 566 fs_node_t *node = NULL; … … 624 634 } 625 635 626 static bool mfs_is_directory(fs_node_t *fsnode) 636 static bool 637 mfs_is_directory(fs_node_t *fsnode) 627 638 { 628 639 const struct mfs_node *node = fsnode->data; … … 630 641 } 631 642 632 static bool mfs_is_file(fs_node_t *fsnode) 643 static bool 644 mfs_is_file(fs_node_t *fsnode) 633 645 { 634 646 struct mfs_node *node = fsnode->data; … … 636 648 } 637 649 638 static int mfs_root_get(fs_node_t **rfn, service_id_t service_id) 650 static int 651 mfs_root_get(fs_node_t **rfn, service_id_t service_id) 639 652 { 640 653 int rc = mfs_node_get(rfn, service_id, MFS_ROOT_INO); … … 642 655 } 643 656 644 static int mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name) 657 static int 658 mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name) 645 659 { 646 660 struct mfs_node *parent = pfn->data; … … 717 731 } 718 732 719 static int mfs_has_children(bool *has_children, fs_node_t *fsnode) 733 static int 734 mfs_has_children(bool *has_children, fs_node_t *fsnode) 720 735 { 721 736 struct mfs_node *mnode = fsnode->data; … … 738 753 739 754 if (d_info.d_inum) { 740 /* A valid entry has been found*/755 /* A valid entry has been found */ 741 756 *has_children = true; 742 757 break; … … 750 765 static int 751 766 mfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 752 767 size_t *rbytes) 753 768 { 754 769 int rc; … … 780 795 781 796 if (pos < 2) { 782 /* Skip the first two dentries ('.' and '..')*/797 /* Skip the first two dentries ('.' and '..') */ 783 798 pos = 2; 784 799 } … … 790 805 791 806 if (d_info.d_inum) { 792 /* Dentry found!*/807 /* Dentry found! */ 793 808 goto found; 794 809 } … … 806 821 807 822 if (pos >= (size_t) ino_i->i_size) { 808 /* Trying to read beyond the end of file*/823 /* Trying to read beyond the end of file */ 809 824 bytes = 0; 810 825 (void) async_data_read_finalize(callid, NULL, 0); … … 823 838 824 839 if (zone == 0) { 825 /* sparse file*/840 /* sparse file */ 826 841 uint8_t *buf = malloc(sbi->block_size); 827 842 if (!buf) { … … 831 846 memset(buf, 0, sizeof(sbi->block_size)); 832 847 async_data_read_finalize(callid, 833 848 buf + pos % sbi->block_size, bytes); 834 849 free(buf); 835 850 goto out_success; … … 841 856 842 857 async_data_read_finalize(callid, b->data + 843 858 pos % sbi->block_size, bytes); 844 859 845 860 rc = block_put(b); … … 862 877 static int 863 878 mfs_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 864 879 size_t *wbytes, aoff64_t *nsize) 865 880 { 866 881 fs_node_t *fn; … … 954 969 return ENOENT; 955 970 956 /* Destroy the inode*/971 /* Destroy the inode */ 957 972 return mfs_destroy_node(fn); 958 973 } … … 973 988 assert(!has_children); 974 989 975 /* Free the entire inode content*/990 /* Free the entire inode content */ 976 991 r = mfs_inode_shrink(mnode, mnode->ino_i->i_size); 977 992 if (r != EOK) 978 993 goto out; 979 994 980 /* Mark the inode as free in the bitmap*/995 /* Mark the inode as free in the bitmap */ 981 996 r = mfs_free_inode(mnode->instance, mnode->ino_i->index); 982 997 … … 1017 1032 1018 1033 rc = fs_instance_get(service_id, &data); 1019 if (rc == EOK) {1034 if (rc == EOK) 1020 1035 *instance = (struct mfs_instance *) data; 1021 }else {1036 else { 1022 1037 mfsdebug("instance not found\n"); 1023 1038 } … … 1026 1041 } 1027 1042 1028 static bool check_magic_number(uint16_t magic, bool *native, 1029 mfs_version_t *version, bool *longfilenames) 1043 static bool 1044 check_magic_number(uint16_t magic, bool *native, 1045 mfs_version_t *version, bool *longfilenames) 1030 1046 { 1031 1047 bool rc = true; -
uspace/srv/fs/mfs/mfs_rw.c
r9269c88 r6d4d883 36 36 static int 37 37 rw_map_ondisk(uint32_t *b, const struct mfs_node *mnode, int rblock, 38 38 bool write_mode, uint32_t w_block); 39 39 40 40 static int … … 68 68 const int block_size = sbi->block_size; 69 69 70 /* Compute relative block number in file*/70 /* Compute relative block number in file */ 71 71 int rblock = pos / block_size; 72 72 73 73 if (ROUND_UP(mnode->ino_i->i_size, sbi->block_size) < pos) { 74 /* Trying to read beyond the end of file*/74 /* Trying to read beyond the end of file */ 75 75 r = EOK; 76 76 *b = 0; … … 85 85 int 86 86 mfs_write_map(struct mfs_node *mnode, const uint32_t pos, uint32_t new_zone, 87 87 uint32_t *old_zone) 88 88 { 89 89 const struct mfs_sb_info *sbi = mnode->instance->sbi; 90 90 91 91 if (pos >= sbi->max_file_size) { 92 /* Can't write beyond the maximum file size*/92 /* Can't write beyond the maximum file size */ 93 93 return EINVAL; 94 94 } 95 95 96 /* Compute the relative block number in file*/96 /* Compute the relative block number in file */ 97 97 int rblock = pos / sbi->block_size; 98 98 … … 102 102 static int 103 103 rw_map_ondisk(uint32_t *b, const struct mfs_node *mnode, int rblock, 104 104 bool write_mode, uint32_t w_block) 105 105 { 106 106 int r, nr_direct; … … 123 123 } 124 124 125 /* Check if the wanted block is in the direct zones*/125 /* Check if the wanted block is in the direct zones */ 126 126 if (rblock < nr_direct) { 127 127 *b = ino_i->i_dzone[rblock]; … … 136 136 137 137 if (rblock < ptrs_per_block) { 138 /* The wanted block is in the single indirect zone chain*/138 /* The wanted block is in the single indirect zone chain */ 139 139 if (ino_i->i_izone[0] == 0) { 140 140 if (write_mode && !deleting) { … … 168 168 rblock -= ptrs_per_block; 169 169 170 /* The wanted block is in the double indirect zone chain*/171 172 /* read the first indirect zone of the chain*/170 /* The wanted block is in the double indirect zone chain */ 171 172 /* Read the first indirect zone of the chain */ 173 173 if (ino_i->i_izone[1] == 0) { 174 174 if (write_mode && !deleting) { … … 181 181 ino_i->dirty = true; 182 182 } else { 183 /* Sparse block*/183 /* Sparse block */ 184 184 *b = 0; 185 185 return EOK; … … 192 192 193 193 /* 194 * Compute the position of the second indirect195 * zone pointer in the chain.194 * Compute the position of the second indirect 195 * zone pointer in the chain. 196 196 */ 197 197 uint32_t ind2_off = rblock / ptrs_per_block; 198 198 199 /* read the second indirect zone of the chain*/199 /* read the second indirect zone of the chain */ 200 200 if (ind_zone[ind2_off] == 0) { 201 201 if (write_mode && !deleting) { … … 208 208 write_ind_zone(inst, ino_i->i_izone[1], ind_zone); 209 209 } else { 210 /* Sparse block*/210 /* Sparse block */ 211 211 r = EOK; 212 212 *b = 0; … … 264 264 265 265 if (rblock < nr_direct) { 266 /* free the single indirect zone*/266 /* Free the single indirect zone */ 267 267 if (ino_i->i_izone[0]) { 268 268 r = mfs_free_zone(inst, ino_i->i_izone[0]); … … 282 282 ++fzone_to_free; 283 283 284 /* free the entire double indirect zone*/284 /* Free the entire double indirect zone */ 285 285 uint32_t *dbl_zone; 286 286 287 287 if (ino_i->i_izone[1] == 0) { 288 /* Nothing to be done*/288 /* Nothing to be done */ 289 289 return EOK; 290 290 } … … 350 350 block_t *b; 351 351 const int max_ind_zone_ptrs = (MFS_MAX_BLOCKSIZE / sizeof(uint16_t)) * 352 352 sizeof(uint32_t); 353 353 354 354 *ind_zone = malloc(max_ind_zone_ptrs); -
uspace/srv/fs/mfs/mfs_utils.c
r9269c88 r6d4d883 34 34 #include "mfs.h" 35 35 36 uint16_t conv16(bool native, uint16_t n) 36 uint16_t 37 conv16(bool native, uint16_t n) 37 38 { 38 39 if (native) … … 42 43 } 43 44 44 uint32_t conv32(bool native, uint32_t n) 45 uint32_t 46 conv32(bool native, uint32_t n) 45 47 { 46 48 if (native) … … 50 52 } 51 53 52 uint64_t conv64(bool native, uint64_t n) 54 uint64_t 55 conv64(bool native, uint64_t n) 53 56 { 54 57 if (native)
Note:
See TracChangeset
for help on using the changeset viewer.