Changes in uspace/lib/ext2/libext2_directory.c [260c052:18626b3] in mainline
- File:
-
- 1 edited
-
uspace/lib/ext2/libext2_directory.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext2/libext2_directory.c
r260c052 r18626b3 45 45 * @param de pointer to linked list directory entry 46 46 */ 47 inline uint32_text2_directory_entry_ll_get_inode(ext2_directory_entry_ll_t *de)47 uint32_t ext2_directory_entry_ll_get_inode(ext2_directory_entry_ll_t *de) 48 48 { 49 49 return uint32_t_le2host(de->inode); … … 55 55 * @param de pointer to linked list directory entry 56 56 */ 57 inline uint16_text2_directory_entry_ll_get_entry_length(57 uint16_t ext2_directory_entry_ll_get_entry_length( 58 58 ext2_directory_entry_ll_t *de) 59 59 { … … 66 66 * @param de pointer to linked list directory entry 67 67 */ 68 inline uint16_text2_directory_entry_ll_get_name_length(68 uint16_t ext2_directory_entry_ll_get_name_length( 69 69 ext2_superblock_t *sb, ext2_directory_entry_ll_t *de) 70 70 { … … 93 93 it->fs = fs; 94 94 95 / * Get the first data block, so we can get the first entry */95 // Get the first data block, so we can get first entry 96 96 rc = ext2_filesystem_get_inode_data_block_index(fs, inode_ref->inode, 0, 97 97 &block_id); … … 133 133 size = ext2_inode_get_size(it->fs->superblock, it->inode_ref->inode); 134 134 135 / * Are we at the end? */135 // Are we at the end? 136 136 if (it->current_offset + skip >= size) { 137 137 rc = block_put(it->current_block); … … 150 150 next_block_idx = (it->current_offset + skip) / block_size; 151 151 152 /* If we are moving accross block boundary, 153 * we need to get another block 154 */ 152 // If we are moving accross block boundary, 153 // we need to get another block 155 154 if (current_block_idx != next_block_idx) { 156 155 rc = block_put(it->current_block); … … 177 176 offset_in_block = (it->current_offset + skip) % block_size; 178 177 179 / * Ensure proper alignment */178 // Ensure proper alignment 180 179 if ((offset_in_block % 4) != 0) { 181 180 it->current = NULL; … … 183 182 } 184 183 185 / * Ensure that the core of the entry does not overflow the block */184 // Ensure that the core of the entry does not overflow the block 186 185 if (offset_in_block > block_size - 8) { 187 186 it->current = NULL; … … 192 191 it->current_offset += skip; 193 192 194 / * Ensure that the whole entry does not overflow the block */193 // Ensure that the whole entry does not overflow the block 195 194 skip = ext2_directory_entry_ll_get_entry_length(it->current); 196 195 if (offset_in_block + skip > block_size) { … … 199 198 } 200 199 201 / * Ensure the name length is not too large */200 // Ensure the name length is not too large 202 201 if (ext2_directory_entry_ll_get_name_length(it->fs->superblock, 203 202 it->current) > skip-8) {
Note:
See TracChangeset
for help on using the changeset viewer.
