Changes in uspace/srv/fs/mfs/mfs_inode.c [6d4d883:40a2af3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_inode.c
r6d4d883 r40a2af3 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) 80 { 79 struct mfs_ino_info **ino_ptr, uint16_t inum) { 81 80 struct mfs_inode *ino; 82 81 struct mfs_ino_info *ino_i = NULL; … … 87 86 sbi = instance->sbi; 88 87 89 /* inode 0 does not exist*/88 /*inode 0 does not exist*/ 90 89 inum -= 1; 91 90 … … 102 101 103 102 r = block_get(&b, instance->service_id, 104 itable_off + inum / sbi->ino_per_block, 105 BLOCK_FLAGS_NONE); 106 103 itable_off + inum / sbi->ino_per_block, 104 BLOCK_FLAGS_NONE); 107 105 if (r != EOK) 108 106 goto out_err; … … 136 134 static int 137 135 mfs2_read_inode_raw(const struct mfs_instance *instance, 138 struct mfs_ino_info **ino_ptr, uint32_t inum) 139 { 136 struct mfs_ino_info **ino_ptr, uint32_t inum) { 140 137 struct mfs2_inode *ino; 141 138 struct mfs_ino_info *ino_i = NULL; … … 153 150 sbi = instance->sbi; 154 151 155 /* inode 0 does not exist*/152 /*inode 0 does not exist*/ 156 153 inum -= 1; 157 154 … … 160 157 161 158 r = block_get(&b, instance->service_id, 162 itable_off + inum / sbi->ino_per_block, 163 BLOCK_FLAGS_NONE); 164 159 itable_off + inum / sbi->ino_per_block, 160 BLOCK_FLAGS_NONE); 165 161 if (r != EOK) 166 162 goto out_err; … … 326 322 327 323 if (size_shrink == 0) { 328 /* Nothing to be done*/324 /*File is empty*/ 329 325 return EOK; 330 326 } … … 337 333 ino_i->dirty = true; 338 334 339 /* Compute the number of zones to free*/335 /*Compute the number of zones to free*/ 340 336 unsigned zones_to_free; 341 337 … … 358 354 359 355 if (old_zone == 0) 360 continue; /* Sparse block*/356 continue; /*Sparse block*/ 361 357 362 358 r = mfs_free_zone(mnode->instance, old_zone);
Note:
See TracChangeset
for help on using the changeset viewer.