Changeset db8fb43 in mainline
- Timestamp:
- 2012-04-18T08:32:35Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e6f6260
- Parents:
- f22d5ef0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory_index.c
rf22d5ef0 rdb8fb43 43 43 #include "libext4.h" 44 44 45 /** Type entry to pass to sorting algorithm. 46 * 47 */ 45 48 typedef struct ext4_dx_sort_entry { 46 49 uint32_t hash; … … 50 53 51 54 55 /** Get hash version used in directory index. 56 * 57 * @param root_info pointer to root info structure of index 58 * @return hash algorithm version 59 */ 52 60 uint8_t ext4_directory_dx_root_info_get_hash_version( 53 61 ext4_directory_dx_root_info_t *root_info) … … 56 64 } 57 65 66 /** Set hash version, that will be used in directory index. 67 * 68 * @param root_info pointer to root info structure of index 69 * @param version hash algorithm version 70 */ 58 71 void ext4_directory_dx_root_info_set_hash_version( 59 72 ext4_directory_dx_root_info_t *root_info, uint8_t version) … … 62 75 } 63 76 77 /** Get length of root_info structure in bytes. 78 * 79 * @param root_info pointer to root info structure of index 80 * @return length of the structure 81 */ 64 82 uint8_t ext4_directory_dx_root_info_get_info_length( 65 83 ext4_directory_dx_root_info_t *root_info) … … 68 86 } 69 87 88 /** Set length of root_info structure in bytes. 89 * 90 * @param root_info pointer to root info structure of index 91 * @param info_length length of the structure 92 */ 70 93 void ext4_directory_dx_root_info_set_info_length( 71 94 ext4_directory_dx_root_info_t *root_info, uint8_t info_length) … … 74 97 } 75 98 99 /** Get number of indirect levels of HTree. 100 * 101 * @param root_info pointer to root info structure of index 102 * @return height of HTree (actually only 0 or 1) 103 */ 76 104 uint8_t ext4_directory_dx_root_info_get_indirect_levels( 77 105 ext4_directory_dx_root_info_t *root_info) … … 80 108 } 81 109 110 /** Set number of indirect levels of HTree. 111 * 112 * @param root_info pointer to root info structure of index 113 * @param levels height of HTree (actually only 0 or 1) 114 */ 82 115 void ext4_directory_dx_root_info_set_indirect_levels( 83 116 ext4_directory_dx_root_info_t *root_info, uint8_t levels) … … 86 119 } 87 120 121 /** Get maximum number of index node entries. 122 * 123 * @param countlimit pointer to counlimit structure 124 * @return maximum of entries in node 125 */ 88 126 uint16_t ext4_directory_dx_countlimit_get_limit( 89 127 ext4_directory_dx_countlimit_t *countlimit) … … 92 130 } 93 131 132 /** Set maximum number of index node entries. 133 * 134 * @param countlimit pointer to counlimit structure 135 * @param limit maximum of entries in node 136 */ 94 137 void ext4_directory_dx_countlimit_set_limit( 95 138 ext4_directory_dx_countlimit_t *countlimit, uint16_t limit) … … 98 141 } 99 142 143 /** Get current number of index node entries. 144 * 145 * @param countlimit pointer to counlimit structure 146 * @return number of entries in node 147 */ 100 148 uint16_t ext4_directory_dx_countlimit_get_count( 101 149 ext4_directory_dx_countlimit_t *countlimit) … … 104 152 } 105 153 154 /** Set current number of index node entries. 155 * 156 * @param countlimit pointer to counlimit structure 157 * @param count number of entries in node 158 */ 106 159 void ext4_directory_dx_countlimit_set_count( 107 160 ext4_directory_dx_countlimit_t *countlimit, uint16_t count) … … 110 163 } 111 164 165 /** Get hash value of index entry. 166 * 167 * @param entry pointer to index entry 168 * @return hash value 169 */ 112 170 uint32_t ext4_directory_dx_entry_get_hash(ext4_directory_dx_entry_t *entry) 113 171 { … … 115 173 } 116 174 175 176 /** Set hash value of index entry. 177 * 178 * @param entry pointer to index entry 179 * @param hash hash value 180 */ 117 181 void ext4_directory_dx_entry_set_hash(ext4_directory_dx_entry_t *entry, 118 182 uint32_t hash) … … 121 185 } 122 186 187 /** Get block address where child node is located. 188 * 189 * @param entry pointer to index entry 190 * @return block address of child node 191 */ 123 192 uint32_t ext4_directory_dx_entry_get_block(ext4_directory_dx_entry_t *entry) 124 193 { … … 126 195 } 127 196 197 /** Set block address where child node is located. 198 * 199 * @param entry pointer to index entry 200 * @param block block address of child node 201 */ 128 202 void ext4_directory_dx_entry_set_block(ext4_directory_dx_entry_t *entry, 129 203 uint32_t block) … … 135 209 /**************************************************************************/ 136 210 211 /** TODO comment all function 212 * 213 */ 137 214 int ext4_directory_dx_init(ext4_inode_ref_t *dir) 138 215 { … … 158 235 ext4_directory_entry_ll_t *dot_dot = (ext4_directory_entry_ll_t *)&root->dots[1]; 159 236 237 238 // TODO why the commented lines?? 160 239 EXT4FS_DBG("dot len = \%u, dotdot len = \%u", ext4_directory_entry_ll_get_entry_length(dot), ext4_directory_entry_ll_get_entry_length(dot_dot)); 161 240
Note:
See TracChangeset
for help on using the changeset viewer.