Changes in uspace/lib/ext2/libext2_directory.c [18626b3:260c052] in mainline
- File:
-
- 1 edited
-
uspace/lib/ext2/libext2_directory.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext2/libext2_directory.c
r18626b3 r260c052 45 45 * @param de pointer to linked list directory entry 46 46 */ 47 uint32_text2_directory_entry_ll_get_inode(ext2_directory_entry_ll_t *de)47 inline 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 uint16_text2_directory_entry_ll_get_entry_length(57 inline 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 uint16_text2_directory_entry_ll_get_name_length(68 inline 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 first entry95 /* Get the first data block, so we can get the 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 152 /* If we are moving accross block boundary, 153 * we need to get another block 154 */ 154 155 if (current_block_idx != next_block_idx) { 155 156 rc = block_put(it->current_block); … … 176 177 offset_in_block = (it->current_offset + skip) % block_size; 177 178 178 / / Ensure proper alignment179 /* Ensure proper alignment */ 179 180 if ((offset_in_block % 4) != 0) { 180 181 it->current = NULL; … … 182 183 } 183 184 184 / / Ensure that the core of the entry does not overflow the block185 /* Ensure that the core of the entry does not overflow the block */ 185 186 if (offset_in_block > block_size - 8) { 186 187 it->current = NULL; … … 191 192 it->current_offset += skip; 192 193 193 / / Ensure that the whole entry does not overflow the block194 /* Ensure that the whole entry does not overflow the block */ 194 195 skip = ext2_directory_entry_ll_get_entry_length(it->current); 195 196 if (offset_in_block + skip > block_size) { … … 198 199 } 199 200 200 / / Ensure the name length is not too large201 /* Ensure the name length is not too large */ 201 202 if (ext2_directory_entry_ll_get_name_length(it->fs->superblock, 202 203 it->current) > skip-8) {
Note:
See TracChangeset
for help on using the changeset viewer.
