Changeset 6f731f0a in mainline
- Timestamp:
- 2012-02-29T18:55:51Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d8269dc
- Parents:
- c0964cd7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory_index.c
rc0964cd7 r6f731f0a 799 799 memset(new_block->data, 0, block_size); 800 800 801 ext4_directory_dx_node_t *new_node = new_block->data; 802 ext4_directory_dx_entry_t *new_entries = new_node->entries; 803 801 804 if (levels > 0) { 802 805 EXT4FS_DBG("split index"); … … 805 808 uint32_t hash_right = ext4_directory_dx_entry_get_hash(entries); 806 809 807 ext4_directory_dx_node_t *new_node = new_block->data;808 ext4_directory_dx_entry_t *new_entries = new_node->entries;809 810 810 memcpy((void *) new_entries, (void *) (entries + count_left), 811 811 count_right * sizeof(ext4_directory_dx_entry_t)); … … 819 819 uint32_t entry_space = block_size - sizeof(ext4_fake_directory_entry_t); 820 820 uint32_t node_limit = entry_space / sizeof(ext4_directory_dx_entry_t); 821 822 821 ext4_directory_dx_countlimit_set_limit(right_countlimit, node_limit); 823 822 … … 839 838 } else { 840 839 EXT4FS_DBG("create second level"); 840 841 memcpy((void *) new_entries, (void *) entries, 842 leaf_count * sizeof(ext4_directory_dx_entry_t)); 843 844 ext4_directory_dx_countlimit_t *new_countlimit = 845 (ext4_directory_dx_countlimit_t *)new_entries; 846 847 uint32_t entry_space = block_size - sizeof(ext4_fake_directory_entry_t); 848 uint32_t node_limit = entry_space / sizeof(ext4_directory_dx_entry_t); 849 ext4_directory_dx_countlimit_set_limit(new_countlimit, node_limit); 850 851 // Set values in root node 852 ext4_directory_dx_countlimit_t *new_root_countlimit = 853 (ext4_directory_dx_countlimit_t *)entries; 854 855 ext4_directory_dx_countlimit_set_limit(new_root_countlimit, 1); 856 ext4_directory_dx_entry_set_block(entries, new_iblock); 857 858 ((ext4_directory_dx_root_t *)dx_blocks[0].block->data)->info.indirect_levels = 1; 859 860 /* Add new access path frame */ 861 dx_block = dx_blocks + 1; 862 dx_block->position = dx_block->position - entries + new_entries; 863 dx_block->entries = new_entries; 864 entries = dx_block->entries; 865 dx_block->block = new_block; 841 866 } 842 867 }
Note:
See TracChangeset
for help on using the changeset viewer.