Changeset 2ea6392 in mainline
- Timestamp:
- 2011-10-10T09:22:25Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7b9381b
- Parents:
- 7a68fe5
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory.c
r7a68fe5 r2ea6392 142 142 } 143 143 144 EXT4FS_DBG("next_block_phys_idx: \%d", next_block_phys_idx);145 146 144 rc = block_get(&it->current_block, it->fs->device, next_block_phys_idx, 147 145 BLOCK_FLAGS_NONE); -
uspace/lib/ext4/libext4_directory.h
r7a68fe5 r2ea6392 37 37 #include "libext4_inode.h" 38 38 39 #define EXT4_FILENAME_LEN 255 40 39 41 /** 40 42 * Linked list directory entry structure … … 48 50 uint8_t inode_type; // Type of referenced inode (in rev >= 0.5) 49 51 } __attribute__ ((packed)); 50 uint8_t name ; // First byte of name, if present52 uint8_t name[EXT4_FILENAME_LEN]; // Entry name 51 53 } __attribute__ ((packed)) ext4_directory_entry_ll_t; 52 54 -
uspace/lib/ext4/libext4_filesystem.c
r7a68fe5 r2ea6392 127 127 } 128 128 129 // Feature checkers 130 bool ext4_filesystem_has_feature_compatible(ext4_filesystem_t *fs, uint32_t feature) 131 { 132 ext4_superblock_t *sb = fs->superblock; 133 134 if (ext4_superblock_get_features_compatible(sb) & feature) { 135 return true; 136 } 137 return false; 138 } 139 140 bool ext4_filesystem_has_feature_incompatible(ext4_filesystem_t *fs, uint32_t feature) 141 { 142 ext4_superblock_t *sb = fs->superblock; 143 144 if (ext4_superblock_get_features_incompatible(sb) & feature) { 145 return true; 146 } 147 return false; 148 } 149 150 bool ext4_filesystem_has_feature_read_only(ext4_filesystem_t *fs, uint32_t feature) 151 { 152 ext4_superblock_t *sb = fs->superblock; 153 154 if (ext4_superblock_get_features_read_only(sb) & feature) { 155 return true; 156 } 157 return false; 158 } 159 160 129 161 int ext4_filesystem_get_block_group_ref(ext4_filesystem_t *fs, uint32_t bgid, 130 162 ext4_block_group_ref_t **ref) -
uspace/lib/ext4/libext4_filesystem.h
r7a68fe5 r2ea6392 104 104 extern int ext4_filesystem_check_sanity(ext4_filesystem_t *fs); 105 105 extern int ext4_filesystem_check_features(ext4_filesystem_t *, bool *); 106 extern bool ext4_filesystem_has_feature_compatible(ext4_filesystem_t *, uint32_t); 107 extern bool ext4_filesystem_has_feature_incompatible(ext4_filesystem_t *, uint32_t); 108 extern bool ext4_filesystem_has_feature_read_only(ext4_filesystem_t *, uint32_t); 106 109 extern int ext4_filesystem_get_block_group_ref(ext4_filesystem_t *, uint32_t, 107 110 ext4_block_group_ref_t **); -
uspace/srv/fs/ext4fs/ext4fs_ops.c
r7a68fe5 r2ea6392 454 454 } 455 455 456 // TODO check if directory uses HTree 457 if (ext4_filesystem_has_feature_compatible(fs, EXT4_FEATURE_COMPAT_DIR_INDEX)) { 458 EXT4FS_DBG("Using HTree"); 459 } 460 456 461 rc = ext4_directory_iterator_init(&it, fs, enode->inode_ref, 0); 457 462 if (rc != EOK) { … … 464 469 name_size = ext4_directory_entry_ll_get_name_length(fs->superblock, 465 470 it.current); 466 if (!ext4fs_is_dots( &it.current->name, name_size)) {471 if (!ext4fs_is_dots(it.current->name, name_size)) { 467 472 found = true; 468 473 break; … … 744 749 bool found = false; 745 750 746 EXT4FS_DBG("inode = \%d", inode_ref->index); 751 // TODO check if directory uses HTree 752 if (ext4_filesystem_has_feature_compatible(inst->filesystem, EXT4_FEATURE_COMPAT_DIR_INDEX)) { 753 EXT4FS_DBG("Using HTree"); 754 } 747 755 748 756 rc = ext4_directory_iterator_init(&it, inst->filesystem, inode_ref, pos); … … 765 773 inst->filesystem->superblock, it.current); 766 774 767 768 char* name = (char *)(&it.current->name);769 770 EXT4FS_DBG("name: \%s", name);771 EXT4FS_DBG("inode-number: \%d", it.current->inode);772 773 775 /* skip . and .. */ 774 if (ext4fs_is_dots( &it.current->name, name_size)) {776 if (ext4fs_is_dots(it.current->name, name_size)) { 775 777 goto skip; 776 778 }
Note:
See TracChangeset
for help on using the changeset viewer.