Changeset 12f55220 in mainline
- Timestamp:
- 2011-10-18T06:29:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7bc4508
- Parents:
- 22ceff3a
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory.h
r22ceff3a r12f55220 37 37 #include "libext4_inode.h" 38 38 39 #define EXT4_ FILENAME_LEN 25539 #define EXT4_DIRECTORY_FILENAME_LEN 255 40 40 41 41 /** … … 50 50 uint8_t inode_type; // Type of referenced inode (in rev >= 0.5) 51 51 } __attribute__ ((packed)); 52 uint8_t name[EXT4_ FILENAME_LEN]; // Entry name52 uint8_t name[EXT4_DIRECTORY_FILENAME_LEN]; // Entry name 53 53 } __attribute__ ((packed)) ext4_directory_entry_ll_t; 54 54 … … 60 60 ext4_directory_entry_ll_t *current; 61 61 } ext4_directory_iterator_t; 62 63 64 /* Structures for indexed directory */ 65 66 typedef struct ext4_directory_dx_dot_entry { 67 uint32_t inode; 68 uint16_t entry_length; 69 uint8_t name_length; 70 uint8_t inode_type; 71 uint8_t name[4]; 72 } ext4_directory_dx_dot_entry_t; 73 74 typedef struct ext4_directory_dx_root_info { 75 uint32_t reserved_zero; 76 uint8_t hash_version; 77 uint8_t info_length; 78 uint8_t indirect_levels; 79 uint8_t unused_flags; 80 } ext4_directory_dx_root_info_t; 81 82 typedef struct ext4_directory_dx_entry { 83 uint32_t hash; 84 uint32_t block; 85 } ext4_directory_dx_entry_t; 86 87 typedef struct ext4_directory_dx_root { 88 ext4_directory_dx_dot_entry_t dots[2]; 89 // TODO insert root info items instead of special datatype 90 ext4_directory_dx_root_info_t info; 91 ext4_directory_dx_entry_t *entries; 92 } ext4_directory_dx_root_t; 93 94 95 #define EXT4_DIRECTORY_HTREE_EOF 0x7fffffff 96 62 97 63 98 extern uint32_t ext4_directory_entry_ll_get_inode(ext4_directory_entry_ll_t *); -
uspace/srv/fs/ext4fs/ext4fs_ops.c
r22ceff3a r12f55220 75 75 static int ext4fs_read_directory(ipc_callid_t, aoff64_t, size_t, 76 76 ext4fs_instance_t *, ext4_inode_ref_t *, size_t *); 77 static int ext4fs_read_dx_directory(ipc_callid_t, aoff64_t, size_t, 78 ext4fs_instance_t *, ext4_inode_ref_t *, size_t *); 77 79 static int ext4fs_read_file(ipc_callid_t, aoff64_t, size_t, ext4fs_instance_t *, 78 80 ext4_inode_ref_t *, size_t *); … … 746 748 bool found = false; 747 749 748 // TODO check if directory uses HTree750 // TODO check super block COMPAT FEATURES 749 751 if (ext4_inode_has_flag(inode_ref->inode, EXT4_INODE_FLAG_INDEX)) { 750 EXT4FS_DBG("Directory using HTree"); 752 rc = ext4fs_read_dx_directory(callid, pos, size, inst, inode_ref, rbytes); 753 // TODO return... 754 // return rc; 751 755 } 752 756 … … 821 825 return ENOENT; 822 826 } 827 } 828 829 int ext4fs_read_dx_directory(ipc_callid_t callid, aoff64_t pos, size_t size, 830 ext4fs_instance_t *inst, ext4_inode_ref_t *inode_ref, size_t *rbytes) 831 { 832 EXT4FS_DBG("Directory using HTree index"); 833 return ENOTSUP; 823 834 } 824 835
Note:
See TracChangeset
for help on using the changeset viewer.