Changeset 8f6bb76e in mainline
- Timestamp:
- 2011-04-10T10:03:31Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 230229de
- Parents:
- ce45f19
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_rw.c
rce45f19 r8f6bb76e 69 69 int rblock = pos / block_size; 70 70 71 if (mnode->ino_i->i_size < (int32_t)pos) {71 if (mnode->ino_i->i_size < pos) { 72 72 /*Trying to read beyond the end of file*/ 73 73 r = EOK; … … 147 147 return EOK; 148 148 } 149 rblock -= nr_direct - 1; 149 150 rblock -= nr_direct; 150 151 151 152 if (rblock < ptrs_per_block) { … … 160 161 ino_i->i_izone[0] = zone; 161 162 ino_i->dirty = true; 162 } else 163 } else { 163 164 return -1; 165 } 164 166 } 165 167 … … 177 179 } 178 180 179 rblock -= ptrs_per_block - 1;181 rblock -= ptrs_per_block; 180 182 181 183 /*The wanted block is in the double indirect zone chain*/ … … 277 279 unsigned i; 278 280 block_t *b; 279 280 *ind_zone = malloc(sbi->block_size); 281 const int max_ind_zone_ptrs = (MFS_MAX_BLOCKSIZE / sizeof(uint16_t)) * 282 sizeof(uint32_t); 283 284 *ind_zone = malloc(max_ind_zone_ptrs); 281 285 if (*ind_zone == NULL) 282 286 return ENOMEM;
Note:
See TracChangeset
for help on using the changeset viewer.