Changeset 245b7945 in mainline for uspace/srv/fs/exfat/exfat_fat.c
- Timestamp:
- 2011-08-14T08:22:25Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5f0e16e4
- Parents:
- a18bd22
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_fat.c
ra18bd22 r245b7945 483 483 } 484 484 485 int bitmap_set_cluster(exfat_bs_t *bs, devmap_handle_t devmap_handle, 486 exfat_cluster_t firstc) 487 { 488 /* TODO */ 489 return EOK; 490 } 491 492 int bitmap_clear_cluster(exfat_bs_t *bs, devmap_handle_t devmap_handle, 493 exfat_cluster_t firstc) 494 { 495 /* TODO */ 496 return EOK; 497 } 498 485 499 int bitmap_set_clusters(exfat_bs_t *bs, devmap_handle_t devmap_handle, 486 500 exfat_cluster_t firstc, exfat_cluster_t count) 487 501 { 488 /* TODO */ 489 return EOK; 490 } 491 502 int rc; 503 exfat_cluster_t clst; 504 clst = firstc; 505 506 while (clst < firstc+count ) { 507 rc = bitmap_set_cluster(bs, devmap_handle, clst); 508 if (rc != EOK) { 509 if ((clst-firstc) > 0) 510 (void) bitmap_clear_clusters(bs, devmap_handle, firstc, clst-firstc); 511 return rc; 512 } 513 clst++; 514 } 515 return EOK; 516 } 517 518 int bitmap_clear_clusters(exfat_bs_t *bs, devmap_handle_t devmap_handle, 519 exfat_cluster_t firstc, exfat_cluster_t count) 520 { 521 int rc; 522 exfat_cluster_t clst; 523 clst = firstc; 524 525 while (clst < firstc+count ) { 526 rc = bitmap_clear_cluster(bs, devmap_handle, clst); 527 if (rc != EOK) 528 return rc; 529 clst++; 530 } 531 return EOK; 532 } 492 533 493 534 int bitmap_alloc_clusters(exfat_bs_t *bs, devmap_handle_t devmap_handle, … … 544 585 exfat_cluster_t count) 545 586 { 546 /* TODO */ 547 return EOK; 587 exfat_cluster_t lastc; 588 lastc = nodep->firstc + ROUND_UP(nodep->size, BPC(bs)) / BPC(bs) - 1; 589 lastc -= count; 590 591 return bitmap_clear_clusters(bs, nodep->idx->devmap_handle, lastc+1, count); 548 592 } 549 593
Note:
See TracChangeset
for help on using the changeset viewer.