Changeset cd860fc in mainline
- Timestamp:
- 2011-08-14T17:36:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 151a4e2
- Parents:
- f061de75
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_ops.c
rf061de75 rcd860fc 282 282 static int exfat_node_get_core(exfat_node_t **nodepp, exfat_idx_t *idxp) 283 283 { 284 block_t *b=NULL;285 exfat_bs_t *bs;286 284 exfat_dentry_t *d; 287 285 exfat_node_t *nodep = NULL; 286 exfat_directory_t di; 288 287 int rc; 289 288 … … 314 313 return rc; 315 314 316 bs = block_bb_get(idxp->devmap_handle); 317 318 rc = exfat_block_get_by_clst(&b, bs, idxp->devmap_handle, 319 idxp->parent_fragmented, idxp->pfc, NULL, 320 (idxp->pdi * sizeof(exfat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE); 321 if (rc != EOK) { 315 exfat_directory_open_parent(&di, idxp->devmap_handle, idxp->pfc, 316 idxp->parent_fragmented); 317 rc = exfat_directory_seek(&di, idxp->pdi); 318 if (rc != EOK) { 319 (void) exfat_directory_close(&di); 322 320 (void) exfat_node_put(FS_NODE(nodep)); 323 321 return rc; 324 322 } 325 326 d = ((exfat_dentry_t *)b->data) + (idxp->pdi % DPS(bs)); 323 rc = exfat_directory_get(&di, &d); 324 if (rc != EOK) { 325 (void) exfat_directory_close(&di); 326 (void) exfat_node_put(FS_NODE(nodep)); 327 return rc; 328 } 329 327 330 switch (exfat_classify_dentry(d)) { 328 331 case EXFAT_DENTRY_FILE: 329 332 nodep->type = (d->file.attr & EXFAT_ATTR_SUBDIR)? 330 333 EXFAT_DIRECTORY : EXFAT_FILE; 331 rc = block_put(b);334 rc = exfat_directory_next(&di); 332 335 if (rc != EOK) { 336 (void) exfat_directory_close(&di); 333 337 (void) exfat_node_put(FS_NODE(nodep)); 334 338 return rc; 335 339 } 336 rc = exfat_block_get_by_clst(&b, bs, idxp->devmap_handle, 337 idxp->parent_fragmented, idxp->pfc, NULL, 338 ((idxp->pdi+1) * sizeof(exfat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE); 340 rc = exfat_directory_get(&di, &d); 339 341 if (rc != EOK) { 342 (void) exfat_directory_close(&di); 340 343 (void) exfat_node_put(FS_NODE(nodep)); 341 344 return rc; 342 345 } 343 d = ((exfat_dentry_t *)b->data) + ((idxp->pdi+1) % DPS(bs));344 345 346 nodep->firstc = d->stream.firstc; 346 347 nodep->size = d->stream.data_size; … … 367 368 case EXFAT_DENTRY_STREAM: 368 369 case EXFAT_DENTRY_NAME: 369 (void) block_put(b);370 (void) exfat_directory_close(&di); 370 371 (void) exfat_node_put(FS_NODE(nodep)); 371 372 return ENOENT; … … 375 376 nodep->refcnt = 1; 376 377 377 rc = block_put(b);378 rc = exfat_directory_close(&di); 378 379 if (rc != EOK) { 379 380 (void) exfat_node_put(FS_NODE(nodep));
Note:
See TracChangeset
for help on using the changeset viewer.