Changeset e5cebc9 in mainline
- Timestamp:
- 2011-04-19T20:59:51Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bfbe16f
- Parents:
- 1494e52
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_inode.c
r1494e52 re5cebc9 323 323 /*Compute the number of zones to add to the inode*/ 324 324 unsigned zones_to_add = 0; 325 if ( (old_size % (bs - 1))== 0)326 zones_to_add++;327 328 zones_to_add += (new_size - old_size) / bs;325 if (old_size == 0) 326 ++zones_to_add; 327 328 zones_to_add += (new_size / bs) - (old_size / bs); 329 329 330 330 /*Compute the start zone*/ … … 333 333 334 334 mfsdebug("zones to add = %u\n", zones_to_add); 335 336 if (zones_to_add == 0) {337 /*Set the new inode size and exit*/338 ino_i->i_size = new_size;339 ino_i->dirty = true;340 return EOK;341 }342 335 343 336 int r; … … 350 343 return r; 351 344 352 r = write_map(mnode, (start_zone + i) * sbi->block_size, 345 mfsdebug("write_map = %d\n", (int) ((start_zone + i) * bs)); 346 347 block_t *b; 348 r = block_get(&b, mnode->instance->handle, new_zone, 349 BLOCK_FLAGS_NOREAD); 350 if (r != EOK) 351 return r; 352 353 memset(b->data, 0, bs); 354 b->dirty = true; 355 block_put(b); 356 357 r = write_map(mnode, (start_zone + i) * bs, 353 358 new_zone, &dummy); 354 359 if (r != EOK) … … 358 363 ino_i->dirty = true; 359 364 } 365 366 ino_i->i_size = new_size; 367 ino_i->dirty = true; 368 360 369 return EOK; 361 370 }
Note:
See TracChangeset
for help on using the changeset viewer.