Changeset 30ac3c3 in mainline
- Timestamp:
- 2012-03-26T06:57:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9463b245
- Parents:
- 6514d1f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r6514d1f r30ac3c3 149 149 } 150 150 151 //static void ext4_extent_binsearch_idx(ext4_extent_path_t *path, uint32_t iblock) 151 //static void ext4_extent_binsearch_idx(ext4_extent_header_t *header, 152 // ext4_extent_index_t **index, uint32_t iblock) 152 153 //{ 153 // ext4_extent_header_t *header = path->header;154 154 // ext4_extent_index_t *r, *l, *m; 155 155 // … … 168 168 // } 169 169 // 170 // path->index = l - 1;170 // *index = l - 1; 171 171 //} 172 172 // 173 static void ext4_extent_binsearch(ext4_extent_ path_t *path, uint32_t iblock)174 { 175 ext4_extent_header_t *header = path->header; 173 static void ext4_extent_binsearch(ext4_extent_header_t *header, 174 ext4_extent_t **extent, uint32_t iblock) 175 { 176 176 ext4_extent_t *r, *l, *m; 177 177 … … 196 196 } 197 197 198 path->extent = l - 1;198 *extent = l - 1; 199 199 200 200 } … … 210 210 while (ext4_extent_header_get_depth(header) != 0) { 211 211 212 // ext4_extent_path_t path2; 213 // path2.header = header; 214 // path2.index = NULL; 215 // ext4_extent_binsearch_idx(header, &path2.index, iblock); 216 // 217 // uint64_t child = ext4_extent_index_get_leaf(path2.index); 218 // if (block != NULL) { 219 // block_put(block); 220 // } 221 // 222 // rc = block_get(&block, fs->device, child, BLOCK_FLAGS_NONE); 223 // if (rc != EOK) { 224 // return rc; 225 // } 226 // 227 // header = block->data; 228 // break; 229 230 212 231 ext4_extent_index_t *extent_index = EXT4_EXTENT_FIRST_INDEX(header); 213 232 214 for (uint16_t i = 0; i < ext4_extent_header_get_entries_count(header); ++i ) {233 for (uint16_t i = 0; i < ext4_extent_header_get_entries_count(header); ++i, extent_index++) { 215 234 if (iblock >= ext4_extent_index_get_first_block(extent_index)) { 216 235 … … 238 257 path.extent = NULL; 239 258 240 ext4_extent_binsearch( &path, iblock);259 ext4_extent_binsearch(path.header, &path.extent, iblock); 241 260 242 261 *ret_extent = path.extent; 243 244 // for (uint16_t i = 0; i < ext4_extent_header_get_entries_count(header); ++i) {245 //246 // uint32_t first_block = ext4_extent_get_first_block(extent);247 // uint16_t block_count = ext4_extent_get_block_count(extent);248 //249 // if ((iblock >= first_block) && (iblock < first_block + block_count)) {250 // break;251 // }252 // // Go to the next extent253 // ++extent;254 // }255 //256 // *ret_extent = extent;257 262 258 263 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.