Changeset 50601ef in mainline
- Timestamp:
- 2012-02-08T19:38:26Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03934c9e
- Parents:
- 565b6ff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory.c
r565b6ff r50601ef 313 313 314 314 // Linear algorithm 315 uint16_t required_len = 8 + name_len + (4 - name_len % 4);316 315 317 316 ext4_directory_iterator_t it; … … 322 321 323 322 uint32_t block_size = ext4_superblock_get_block_size(fs->superblock); 323 uint16_t required_len = 8 + name_len + (4 - name_len % 4); 324 324 325 325 while (it.current != NULL) { … … 328 328 329 329 if ((entry_inode == 0) && (rec_len >= required_len)) { 330 331 330 332 331 ext4_directory_write_entry(fs->superblock, it.current, rec_len, … … 349 348 350 349 if (free_space >= required_len) { 351 uint16_t used_len = rec_len - free_space;352 350 353 351 // Cut tail of current entry 354 ext4_directory_entry_ll_set_entry_length(it.current, used_ len);352 ext4_directory_entry_ll_set_entry_length(it.current, used_space); 355 353 356 354 // SEEK manually 357 355 uint32_t local_offset = (it.current_offset % block_size); 358 local_offset += used_ len;356 local_offset += used_space; 359 357 ext4_directory_entry_ll_t *new_entry = it.current_block->data + local_offset; 360 358 … … 375 373 } 376 374 } 375 376 EXT4FS_DBG("NO FREE SPACE - needed to allocate block"); 377 377 378 378 // Save position and destroy iterator
Note:
See TracChangeset
for help on using the changeset viewer.