Changeset f01fea3 in mainline
- Timestamp:
- 2011-08-02T19:08:36Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8f54827
- Parents:
- 1f1d96a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_ops.c
r1f1d96a rf01fea3 62 62 #define EXFAT_NODE(node) ((node) ? (exfat_node_t *) (node)->data : NULL) 63 63 #define FS_NODE(node) ((node) ? (node)->bp : NULL) 64 64 #define DPS(bs) (BPS((bs)) / sizeof(exfat_dentry_t)) 65 65 66 66 /** Mutex protecting the list of cached free FAT nodes. */ … … 259 259 { 260 260 block_t *b=NULL; 261 //exfat_bs_t *bs;262 //exfat_dentry_t *d;261 exfat_bs_t *bs; 262 exfat_dentry_t *d; 263 263 exfat_node_t *nodep = NULL; 264 264 int rc; … … 290 290 return rc; 291 291 292 //bs = block_bb_get(idxp->devmap_handle); 293 294 /* Access to exFAT directory and read two entries: 295 * file entry and stream entry 296 */ 297 /* 298 exfat_directory_t di; 299 exfat_dentry_t *de; 300 exfat_directory_open(&di, ???); 301 exfat_directory_seek(&di, idxp->pdi); 302 exfat_directory_get(&di, &de); 303 304 switch (exfat_classify_dentry(de)) { 292 bs = block_bb_get(idxp->devmap_handle); 293 294 rc = exfat_block_get_by_clst(&b, bs, idxp->devmap_handle, 295 idxp->parent_fragmented, idxp->pfc, NULL, 296 (idxp->pdi * sizeof(exfat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE); 297 if (rc != EOK) { 298 (void) exfat_node_put(FS_NODE(nodep)); 299 return rc; 300 } 301 302 d = ((exfat_dentry_t *)b->data) + (idxp->pdi % DPS(bs)); 303 switch (exfat_classify_dentry(d)) { 305 304 case EXFAT_DENTRY_FILE: 306 nodep->type = (d e->file.attr & EXFAT_ATTR_SUBDIR)?305 nodep->type = (d->file.attr & EXFAT_ATTR_SUBDIR)? 307 306 EXFAT_DIRECTORY : EXFAT_FILE; 308 exfat_directory_next(&di); 309 exfat_directory_get(&di, &de); 310 nodep->firtsc = de->stream.firstc; 311 nodep->size = de->stream.data_size; 312 nodep->fragmented = (de->stream.flags & 0x02) == 0; 307 rc = block_put(b); 308 if (rc != EOK) { 309 (void) exfat_node_put(FS_NODE(nodep)); 310 return rc; 311 } 312 rc = exfat_block_get_by_clst(&b, bs, idxp->devmap_handle, 313 idxp->parent_fragmented, idxp->pfc, NULL, 314 ((idxp->pdi+1) * sizeof(exfat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE); 315 if (rc != EOK) { 316 (void) exfat_node_put(FS_NODE(nodep)); 317 return rc; 318 } 319 d = ((exfat_dentry_t *)b->data) + ((idxp->pdi+1) % DPS(bs)); 320 321 nodep->firstc = d->stream.firstc; 322 nodep->size = d->stream.data_size; 323 nodep->fragmented = (d->stream.flags & 0x02) == 0; 313 324 break; 314 325 case EXFAT_DENTRY_BITMAP: 315 326 nodep->type = EXFAT_BITMAP; 316 nodep->firstc = d e->bitmap.firstc;317 nodep->size = d e->bitmap.size;318 nodep->fragmented = false;327 nodep->firstc = d->bitmap.firstc; 328 nodep->size = d->bitmap.size; 329 nodep->fragmented = true; 319 330 break; 320 331 case EXFAT_DENTRY_UCTABLE: 321 332 nodep->type = EXFAT_UCTABLE; 322 nodep->firstc = d e->uctable.firstc;323 nodep->size = d e->uctable.size;324 nodep->fragmented = false;333 nodep->firstc = d->uctable.firstc; 334 nodep->size = d->uctable.size; 335 nodep->fragmented = true; 325 336 break; 326 337 default: … … 333 344 case EXFAT_DENTRY_NAME: 334 345 (void) block_put(b); 335 (void) fat_node_put(FS_NODE(nodep));346 (void) exfat_node_put(FS_NODE(nodep)); 336 347 return ENOENT; 337 348 } 338 */339 340 /* Read the block that contains the dentry of interest. */341 /*342 rc = _fat_block_get(&b, bs, idxp->devmap_handle, idxp->pfc, NULL,343 (idxp->pdi * sizeof(fat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE);344 if (rc != EOK) {345 (void) fat_node_put(FS_NODE(nodep));346 return rc;347 }348 349 d = ((fat_dentry_t *)b->data) + (idxp->pdi % DPS(bs));350 */351 349 352 350 nodep->lnkcnt = 1; … … 393 391 int exfat_match(fs_node_t **rfn, fs_node_t *pfn, const char *component) 394 392 { 393 /* TODO */ 395 394 *rfn = NULL; 396 395 return EOK; … … 428 427 int exfat_node_put(fs_node_t *fn) 429 428 { 429 /* TODO */ 430 430 return EOK; 431 431 } … … 433 433 int exfat_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags) 434 434 { 435 /* TODO */ 435 436 *rfn = NULL; 436 437 return EOK; … … 439 440 int exfat_destroy_node(fs_node_t *fn) 440 441 { 442 /* TODO */ 441 443 return EOK; 442 444 } … … 444 446 int exfat_link(fs_node_t *pfn, fs_node_t *cfn, const char *name) 445 447 { 448 /* TODO */ 446 449 return EOK; 447 450 } … … 449 452 int exfat_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *nm) 450 453 { 454 /* TODO */ 451 455 return EOK; 452 456 }
Note:
See TracChangeset
for help on using the changeset viewer.