Changeset b7fd2a0 in mainline for uspace/lib/ext4/src/directory.c
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/src/directory.c
r36f0738 rb7fd2a0 169 169 } 170 170 171 static int ext4_directory_iterator_seek(ext4_directory_iterator_t *, aoff64_t);172 static int ext4_directory_iterator_set(ext4_directory_iterator_t *, uint32_t);171 static errno_t ext4_directory_iterator_seek(ext4_directory_iterator_t *, aoff64_t); 172 static errno_t ext4_directory_iterator_set(ext4_directory_iterator_t *, uint32_t); 173 173 174 174 /** Initialize directory iterator. … … 183 183 * 184 184 */ 185 int ext4_directory_iterator_init(ext4_directory_iterator_t *it,185 errno_t ext4_directory_iterator_init(ext4_directory_iterator_t *it, 186 186 ext4_inode_ref_t *inode_ref, aoff64_t pos) 187 187 { … … 201 201 * 202 202 */ 203 int ext4_directory_iterator_next(ext4_directory_iterator_t *it)203 errno_t ext4_directory_iterator_next(ext4_directory_iterator_t *it) 204 204 { 205 205 assert(it->current != NULL); … … 220 220 * 221 221 */ 222 int ext4_directory_iterator_seek(ext4_directory_iterator_t *it, aoff64_t pos)222 errno_t ext4_directory_iterator_seek(ext4_directory_iterator_t *it, aoff64_t pos) 223 223 { 224 224 uint64_t size = ext4_inode_get_size(it->inode_ref->fs->superblock, … … 231 231 if (pos >= size) { 232 232 if (it->current_block) { 233 int rc = block_put(it->current_block);233 errno_t rc = block_put(it->current_block); 234 234 it->current_block = NULL; 235 235 … … 255 255 (current_block_idx != next_block_idx)) { 256 256 if (it->current_block) { 257 int rc = block_put(it->current_block);257 errno_t rc = block_put(it->current_block); 258 258 it->current_block = NULL; 259 259 … … 263 263 264 264 uint32_t next_block_phys_idx; 265 int rc = ext4_filesystem_get_inode_data_block_index(it->inode_ref,265 errno_t rc = ext4_filesystem_get_inode_data_block_index(it->inode_ref, 266 266 next_block_idx, &next_block_phys_idx); 267 267 if (rc != EOK) … … 289 289 * 290 290 */ 291 static int ext4_directory_iterator_set(ext4_directory_iterator_t *it,291 static errno_t ext4_directory_iterator_set(ext4_directory_iterator_t *it, 292 292 uint32_t block_size) 293 293 { … … 331 331 * 332 332 */ 333 int ext4_directory_iterator_fini(ext4_directory_iterator_t *it)333 errno_t ext4_directory_iterator_fini(ext4_directory_iterator_t *it) 334 334 { 335 335 it->inode_ref = NULL; … … 386 386 * 387 387 */ 388 int ext4_directory_add_entry(ext4_inode_ref_t *parent, const char *name,388 errno_t ext4_directory_add_entry(ext4_inode_ref_t *parent, const char *name, 389 389 ext4_inode_ref_t *child) 390 390 { … … 395 395 EXT4_FEATURE_COMPAT_DIR_INDEX)) && 396 396 (ext4_inode_has_flag(parent->inode, EXT4_INODE_FLAG_INDEX))) { 397 int rc = ext4_directory_dx_add_entry(parent, child, name);397 errno_t rc = ext4_directory_dx_add_entry(parent, child, name); 398 398 399 399 /* Check if index is not corrupted */ … … 419 419 bool success = false; 420 420 for (iblock = 0; iblock < total_blocks; ++iblock) { 421 int rc = ext4_filesystem_get_inode_data_block_index(parent,421 errno_t rc = ext4_filesystem_get_inode_data_block_index(parent, 422 422 iblock, &fblock); 423 423 if (rc != EOK) … … 447 447 iblock = 0; 448 448 fblock = 0; 449 int rc = ext4_filesystem_append_inode_block(parent, &fblock, &iblock);449 errno_t rc = ext4_filesystem_append_inode_block(parent, &fblock, &iblock); 450 450 if (rc != EOK) 451 451 return rc; … … 479 479 * 480 480 */ 481 int ext4_directory_find_entry(ext4_directory_search_result_t *result,481 errno_t ext4_directory_find_entry(ext4_directory_search_result_t *result, 482 482 ext4_inode_ref_t *parent, const char *name) 483 483 { … … 490 490 EXT4_FEATURE_COMPAT_DIR_INDEX)) && 491 491 (ext4_inode_has_flag(parent->inode, EXT4_INODE_FLAG_INDEX))) { 492 int rc = ext4_directory_dx_find_entry(result, parent, name_len,492 errno_t rc = ext4_directory_dx_find_entry(result, parent, name_len, 493 493 name); 494 494 … … 517 517 for (iblock = 0; iblock < total_blocks; ++iblock) { 518 518 /* Load block address */ 519 int rc = ext4_filesystem_get_inode_data_block_index(parent, iblock,519 errno_t rc = ext4_filesystem_get_inode_data_block_index(parent, iblock, 520 520 &fblock); 521 521 if (rc != EOK) … … 561 561 * 562 562 */ 563 int ext4_directory_remove_entry(ext4_inode_ref_t *parent, const char *name)563 errno_t ext4_directory_remove_entry(ext4_inode_ref_t *parent, const char *name) 564 564 { 565 565 /* Check if removing from directory */ … … 570 570 /* Try to find entry */ 571 571 ext4_directory_search_result_t result; 572 int rc = ext4_directory_find_entry(&result, parent, name);572 errno_t rc = ext4_directory_find_entry(&result, parent, name); 573 573 if (rc != EOK) 574 574 return rc; … … 626 626 * 627 627 */ 628 int ext4_directory_try_insert_entry(ext4_superblock_t *sb,628 errno_t ext4_directory_try_insert_entry(ext4_superblock_t *sb, 629 629 block_t *target_block, ext4_inode_ref_t *child, const char *name, 630 630 uint32_t name_len) … … 705 705 * 706 706 */ 707 int ext4_directory_find_in_block(block_t *block, ext4_superblock_t *sb,707 errno_t ext4_directory_find_in_block(block_t *block, ext4_superblock_t *sb, 708 708 size_t name_len, const char *name, ext4_directory_entry_ll_t **res_entry) 709 709 { … … 756 756 * 757 757 */ 758 int ext4_directory_destroy_result(ext4_directory_search_result_t *result)758 errno_t ext4_directory_destroy_result(ext4_directory_search_result_t *result) 759 759 { 760 760 if (result->block)
Note:
See TracChangeset
for help on using the changeset viewer.