Changeset 6f41312 in mainline
- Timestamp:
- 2012-04-08T09:09:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 95947d24
- Parents:
- 1196df6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r1196df6 r6f41312 302 302 rc = block_get(&block, inode_ref->fs->device, fblock, BLOCK_FLAGS_NONE); 303 303 if (rc != EOK) { 304 // TODO cleanup 305 EXT4FS_DBG("ERRRR"); 306 return rc; 304 goto cleanup; 307 305 } 308 306 … … 325 323 326 324 return EOK; 325 326 cleanup: 327 // Put loaded blocks 328 // From 1 -> 0 is a block with inode data 329 for (uint16_t i = 1; i < tmp_path->depth; ++i) { 330 if (tmp_path[i].block) { 331 block_put(tmp_path[i].block); 332 } 333 } 334 335 // Destroy temporary data structure 336 free(tmp_path); 337 338 return rc; 339 327 340 } 328 341 … … 400 413 uint32_t iblock_from) 401 414 { 402 int rc ;415 int rc = EOK; 403 416 404 417 // Find the first extent to modify … … 429 442 rc = ext4_balloc_free_blocks(inode_ref, first_fblock, delete_count); 430 443 if (rc != EOK) { 431 // TODO goto cleanup 432 EXT4FS_DBG("ERROR"); 433 return rc; 444 goto cleanup; 434 445 } 435 446 … … 454 465 rc = ext4_balloc_free_blocks(inode_ref, first_fblock, delete_count); 455 466 if (rc != EOK) { 456 // TODO goto cleanup 457 EXT4FS_DBG("ERROR"); 458 return rc; 467 goto cleanup; 459 468 } 460 469 … … 472 481 rc = ext4_balloc_free_block(inode_ref, path_ptr->block->lba); 473 482 if (rc != EOK) { 474 EXT4FS_DBG("ERROR"); 475 // TODO goto cleanup 476 return rc; 483 goto cleanup; 477 484 } 478 485 check_tree = true; … … 497 504 rc = ext4_extent_release_branch(inode_ref, index); 498 505 if (rc != EOK) { 499 EXT4FS_DBG("ERR"); 500 // TODO goto cleanup 501 return rc; 506 goto cleanup; 502 507 } 503 508 ++index; … … 511 516 rc = ext4_balloc_free_block(inode_ref, path_ptr->block->lba); 512 517 if (rc != EOK) { 513 EXT4FS_DBG("ERROR"); 514 // TODO goto cleanup 515 return rc; 518 goto cleanup; 516 519 } 517 520 check_tree = true; … … 524 527 525 528 526 // Finish 527 uint16_t depth = path->depth; 528 529 cleanup: 529 530 // Put loaded blocks 530 531 // From 1 -> 0 is a block with inode data 531 for (uint16_t i = 1; i < depth; ++i) {532 for (uint16_t i = 1; i < path->depth; ++i) { 532 533 if (path[i].block) { 533 534 block_put(path[i].block); … … 538 539 free(path); 539 540 540 return EOK;541 return rc; 541 542 } 542 543 … … 544 545 uint32_t *iblock, uint32_t *fblock) 545 546 { 546 int rc ;547 int rc = EOK; 547 548 548 549 ext4_superblock_t *sb = inode_ref->fs->superblock; … … 569 570 rc = ext4_extent_find_extent(inode_ref, new_block_idx, &path); 570 571 if (rc != EOK) { 571 EXT4FS_DBG("find extent ERROR");572 572 return rc; 573 573 } … … 590 590 rc = ext4_balloc_alloc_block(inode_ref, &phys_block); 591 591 if (rc != EOK) { 592 EXT4FS_DBG("ERRO in balloc"); 593 return rc; 592 goto finish; 594 593 } 595 594 … … 626 625 free(path); 627 626 628 return EOK;627 return rc; 629 628 } 630 629
Note:
See TracChangeset
for help on using the changeset viewer.