Changes in uspace/srv/fs/fat/fat_fat.c [b7fd2a0:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
rb7fd2a0 rcde999a 73 73 * @return EOK on success or an error code. 74 74 */ 75 errno_t75 int 76 76 fat_cluster_walk(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc, 77 77 fat_cluster_t *lastc, uint32_t *numc, uint32_t max_clusters) … … 80 80 fat_cluster_t clst = firstc, clst_last1 = FAT_CLST_LAST1(bs); 81 81 fat_cluster_t clst_bad = FAT_CLST_BAD(bs); 82 errno_t rc;82 int rc; 83 83 84 84 if (firstc == FAT_CLST_RES0) { … … 123 123 * @return EOK on success or an error code. 124 124 */ 125 errno_t125 int 126 126 fat_block_get(block_t **block, struct fat_bs *bs, fat_node_t *nodep, 127 127 aoff64_t bn, int flags) … … 130 130 fat_cluster_t currc = 0; 131 131 aoff64_t relbn = bn; 132 errno_t rc;132 int rc; 133 133 134 134 if (!nodep->size) … … 188 188 * @return EOK on success or an error code. 189 189 */ 190 errno_t190 int 191 191 _fat_block_get(block_t **block, fat_bs_t *bs, service_id_t service_id, 192 192 fat_cluster_t fcl, fat_cluster_t *clp, aoff64_t bn, int flags) … … 195 195 uint32_t max_clusters; 196 196 fat_cluster_t c = 0; 197 errno_t rc;197 int rc; 198 198 199 199 /* … … 237 237 * @return EOK on success or an error code. 238 238 */ 239 errno_t239 int 240 240 fat_fill_gap(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, aoff64_t pos) 241 241 { 242 242 block_t *b; 243 243 aoff64_t o, boundary; 244 errno_t rc;244 int rc; 245 245 246 246 boundary = ROUND_UP(nodep->size, BPS(bs) * SPC(bs)); … … 289 289 * @return EOK or an error code. 290 290 */ 291 static errno_t291 static int 292 292 fat_get_cluster_fat12(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 293 293 fat_cluster_t clst, fat_cluster_t *value) … … 296 296 uint16_t byte1, byte2; 297 297 aoff64_t offset; 298 errno_t rc;298 int rc; 299 299 300 300 offset = (clst + clst / 2); … … 359 359 * @return EOK or an error code. 360 360 */ 361 static errno_t361 static int 362 362 fat_get_cluster_fat16(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 363 363 fat_cluster_t clst, fat_cluster_t *value) … … 365 365 block_t *b; 366 366 aoff64_t offset; 367 errno_t rc;367 int rc; 368 368 369 369 offset = (clst * FAT16_CLST_SIZE); … … 390 390 * @return EOK or an error code. 391 391 */ 392 static errno_t392 static int 393 393 fat_get_cluster_fat32(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 394 394 fat_cluster_t clst, fat_cluster_t *value) … … 396 396 block_t *b; 397 397 aoff64_t offset; 398 errno_t rc;398 int rc; 399 399 400 400 offset = (clst * FAT32_CLST_SIZE); … … 423 423 * @return EOK or an error code. 424 424 */ 425 errno_t425 int 426 426 fat_get_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 427 427 fat_cluster_t clst, fat_cluster_t *value) 428 428 { 429 errno_t rc;429 int rc; 430 430 431 431 assert(fatno < FATCNT(bs)); … … 451 451 * @return EOK on success or an error code. 452 452 */ 453 static errno_t453 static int 454 454 fat_set_cluster_fat12(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 455 455 fat_cluster_t clst, fat_cluster_t value) … … 458 458 aoff64_t offset; 459 459 uint16_t byte1, byte2; 460 errno_t rc;460 int rc; 461 461 462 462 offset = (clst + clst / 2); … … 539 539 * @return EOK on success or an error code. 540 540 */ 541 static errno_t541 static int 542 542 fat_set_cluster_fat16(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 543 543 fat_cluster_t clst, fat_cluster_t value) … … 545 545 block_t *b; 546 546 aoff64_t offset; 547 errno_t rc;547 int rc; 548 548 549 549 offset = (clst * FAT16_CLST_SIZE); … … 572 572 * @return EOK on success or an error code. 573 573 */ 574 static errno_t574 static int 575 575 fat_set_cluster_fat32(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 576 576 fat_cluster_t clst, fat_cluster_t value) … … 578 578 block_t *b; 579 579 aoff64_t offset; 580 errno_t rc;580 int rc; 581 581 fat_cluster_t temp; 582 582 … … 609 609 * @return EOK on success or an error code. 610 610 */ 611 errno_t611 int 612 612 fat_set_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 613 613 fat_cluster_t clst, fat_cluster_t value) 614 614 { 615 errno_t rc;615 int rc; 616 616 617 617 assert(fatno < FATCNT(bs)); … … 636 636 * @return EOK on success or an error code. 637 637 */ 638 errno_t fat_alloc_shadow_clusters(fat_bs_t *bs, service_id_t service_id,638 int fat_alloc_shadow_clusters(fat_bs_t *bs, service_id_t service_id, 639 639 fat_cluster_t *lifo, unsigned nclsts) 640 640 { … … 642 642 unsigned c; 643 643 fat_cluster_t clst_last1 = FAT_CLST_LAST1(bs); 644 errno_t rc;644 int rc; 645 645 646 646 for (fatno = FAT1 + 1; fatno < FATCNT(bs); fatno++) { … … 673 673 * @return EOK on success, an error code otherwise. 674 674 */ 675 errno_t675 int 676 676 fat_alloc_clusters(fat_bs_t *bs, service_id_t service_id, unsigned nclsts, 677 677 fat_cluster_t *mcl, fat_cluster_t *lcl) … … 682 682 fat_cluster_t value = 0; 683 683 fat_cluster_t clst_last1 = FAT_CLST_LAST1(bs); 684 errno_t rc = EOK;684 int rc = EOK; 685 685 686 686 lifo = (fat_cluster_t *) malloc(nclsts * sizeof(fat_cluster_t)); … … 744 744 * @return EOK on success or an error code. 745 745 */ 746 errno_t746 int 747 747 fat_free_clusters(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc) 748 748 { … … 750 750 fat_cluster_t nextc = 0; 751 751 fat_cluster_t clst_bad = FAT_CLST_BAD(bs); 752 errno_t rc;752 int rc; 753 753 754 754 /* Mark all clusters in the chain as free in all copies of FAT. */ … … 782 782 * @return EOK on success or an error code. 783 783 */ 784 errno_t fat_append_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl,784 int fat_append_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, 785 785 fat_cluster_t lcl) 786 786 { … … 788 788 fat_cluster_t lastc = 0; 789 789 uint8_t fatno; 790 errno_t rc;790 int rc; 791 791 792 792 if (nodep->firstc == FAT_CLST_RES0) { … … 829 829 * @return EOK on success or an error code. 830 830 */ 831 errno_t fat_chop_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t lcl)831 int fat_chop_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t lcl) 832 832 { 833 833 fat_cluster_t clst_last1 = FAT_CLST_LAST1(bs); 834 errno_t rc;834 int rc; 835 835 service_id_t service_id = nodep->idx->service_id; 836 836 … … 880 880 } 881 881 882 errno_t882 int 883 883 fat_zero_cluster(struct fat_bs *bs, service_id_t service_id, fat_cluster_t c) 884 884 { 885 885 int i; 886 886 block_t *b; 887 errno_t rc;887 int rc; 888 888 889 889 for (i = 0; i < SPC(bs); i++) { … … 908 908 * does not contain a fat file system. 909 909 */ 910 errno_t fat_sanity_check(fat_bs_t *bs, service_id_t service_id)910 int fat_sanity_check(fat_bs_t *bs, service_id_t service_id) 911 911 { 912 912 fat_cluster_t e0 = 0; 913 913 fat_cluster_t e1 = 0; 914 914 unsigned fat_no; 915 errno_t rc;915 int rc; 916 916 917 917 /* Check number of FATs. */
Note:
See TracChangeset
for help on using the changeset viewer.