Changeset 001307cf in mainline
- Timestamp:
- 2012-04-03T14:09:06Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d3ee35b
- Parents:
- 0d4db0f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r0d4db0f r001307cf 275 275 uint16_t depth = ext4_extent_header_get_depth(eh); 276 276 277 // EXT4FS_DBG("depth = \%u", depth);278 // EXT4FS_DBG("header = \%u", (uint32_t)eh);279 // EXT4FS_DBG("entries_count = \%u", ext4_extent_header_get_entries_count(eh));280 // EXT4FS_DBG("max entries_count = \%u", ext4_extent_header_get_max_entries_count(eh));281 282 277 ext4_extent_path_t *tmp_path; 283 278 … … 326 321 ext4_extent_binsearch(tmp_path[pos].header, &tmp_path[pos].extent, iblock); 327 322 328 EXT4FS_DBG("extent = \%u", (uint32_t)tmp_path[pos].extent);329 330 323 *ret_path = tmp_path; 331 324 … … 362 355 ext4_extent_set_block_count(path_ptr->extent, block_count); 363 356 357 path_ptr->block->dirty = true; 358 359 bool check_tree = false; 360 364 361 if (block_count == 0) { 365 362 uint16_t entries = ext4_extent_header_get_entries_count(path_ptr->header); … … 367 364 ext4_extent_header_set_entries_count(path_ptr->header, entries); 368 365 369 // TODO if empty leaf, release it 370 371 } 372 373 path_ptr->block->dirty = true; 366 // If empty leaf, will be released and the whole tree must be checked 367 check_tree = true; 368 } 369 370 while (check_tree) { 371 372 if (path_ptr > path) { 373 // TODO 374 375 // zahodit fblock 376 rc = ext4_balloc_free_block(inode_ref, path_ptr->block->pba); 377 if (rc != EOK) { 378 EXT4FS_DBG("ERROR"); 379 // TODO 380 } 381 } else { 382 check_tree = false; 383 } 384 385 path_ptr--; 386 387 uint16_t entries = ext4_extent_header_get_entries_count(path_ptr->header); 388 entries--; 389 ext4_extent_header_set_entries_count(path_ptr->header, entries); 390 391 if (entries > 0) { 392 check_tree = false; 393 } 394 } 374 395 375 396 rc = ext4_balloc_free_block(inode_ref, fblock); 376 397 if (rc != EOK) { 398 EXT4FS_DBG("ERROR"); 377 399 // TODO handle error 378 400 }
Note:
See TracChangeset
for help on using the changeset viewer.