Changes in uspace/srv/fs/mfs/mfs_inode.c [40a2af3:6d4d883] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_inode.c
r40a2af3 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 /* File is empty*/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);
Note:
See TracChangeset
for help on using the changeset viewer.