Changes in uspace/srv/fs/fat/fat_fat.c [38d150e:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r38d150e rb7fd2a0 71 71 * @param max_clusters Maximum number of clusters to visit. 72 72 * 73 * @return EOK on success or a negativeerror code.74 */ 75 int73 * @return EOK on success or an error code. 74 */ 75 errno_t 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 int rc;82 errno_t rc; 83 83 84 84 if (firstc == FAT_CLST_RES0) { … … 121 121 * @param flags Flags passed to libblock. 122 122 * 123 * @return EOK on success or a negativeerror code.124 */ 125 int123 * @return EOK on success or an error code. 124 */ 125 errno_t 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 int rc;132 errno_t rc; 133 133 134 134 if (!nodep->size) … … 186 186 * @param flags Flags passed to libblock. 187 187 * 188 * @return EOK on success or a negativeerror code.189 */ 190 int188 * @return EOK on success or an error code. 189 */ 190 errno_t 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 int rc;197 errno_t rc; 198 198 199 199 /* … … 235 235 * @param pos Position in the last node block. 236 236 * 237 * @return EOK on success or a negativeerror code.238 */ 239 int237 * @return EOK on success or an error code. 238 */ 239 errno_t 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 int rc;244 errno_t rc; 245 245 246 246 boundary = ROUND_UP(nodep->size, BPS(bs) * SPC(bs)); … … 287 287 * @param value Output argument holding the value of the cluster. 288 288 * 289 * @return EOK or a negativeerror code.290 */ 291 static int289 * @return EOK or an error code. 290 */ 291 static errno_t 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 int rc;298 errno_t rc; 299 299 300 300 offset = (clst + clst / 2); … … 357 357 * @param value Output argument holding the value of the cluster. 358 358 * 359 * @return EOK or a negativeerror code.360 */ 361 static int359 * @return EOK or an error code. 360 */ 361 static errno_t 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 int rc;367 errno_t rc; 368 368 369 369 offset = (clst * FAT16_CLST_SIZE); … … 388 388 * @param value Output argument holding the value of the cluster. 389 389 * 390 * @return EOK or a negativeerror code.391 */ 392 static int390 * @return EOK or an error code. 391 */ 392 static errno_t 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 int rc;398 errno_t rc; 399 399 400 400 offset = (clst * FAT32_CLST_SIZE); … … 421 421 * @param value Output argument holding the value of the cluster. 422 422 * 423 * @return EOK or a negativeerror code.424 */ 425 int423 * @return EOK or an error code. 424 */ 425 errno_t 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 int rc;429 errno_t rc; 430 430 431 431 assert(fatno < FATCNT(bs)); … … 449 449 * @param value Value to set the cluster with. 450 450 * 451 * @return EOK on success or a negativeerror code.452 */ 453 static int451 * @return EOK on success or an error code. 452 */ 453 static errno_t 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 int rc;460 errno_t rc; 461 461 462 462 offset = (clst + clst / 2); … … 537 537 * @param value Value to set the cluster with. 538 538 * 539 * @return EOK on success or a negativeerror code.540 */ 541 static int539 * @return EOK on success or an error code. 540 */ 541 static errno_t 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 int rc;547 errno_t rc; 548 548 549 549 offset = (clst * FAT16_CLST_SIZE); … … 570 570 * @param value Value to set the cluster with. 571 571 * 572 * @return EOK on success or a negativeerror code.573 */ 574 static int572 * @return EOK on success or an error code. 573 */ 574 static errno_t 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 int rc;580 errno_t rc; 581 581 fat_cluster_t temp; 582 582 … … 607 607 * @param value Value to set the cluster with. 608 608 * 609 * @return EOK on success or a negativeerror code.610 */ 611 int609 * @return EOK on success or an error code. 610 */ 611 errno_t 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 int rc;615 errno_t rc; 616 616 617 617 assert(fatno < FATCNT(bs)); … … 634 634 * @param nclsts Number of clusters in the lifo chain. 635 635 * 636 * @return EOK on success or a negativeerror code.637 */ 638 int fat_alloc_shadow_clusters(fat_bs_t *bs, service_id_t service_id,636 * @return EOK on success or an error code. 637 */ 638 errno_t 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 int rc;644 errno_t rc; 645 645 646 646 for (fatno = FAT1 + 1; fatno < FATCNT(bs); fatno++) { … … 671 671 * will be returned. 672 672 * 673 * @return EOK on success, a negativeerror code otherwise.674 */ 675 int673 * @return EOK on success, an error code otherwise. 674 */ 675 errno_t 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 int rc = EOK;684 errno_t rc = EOK; 685 685 686 686 lifo = (fat_cluster_t *) malloc(nclsts * sizeof(fat_cluster_t)); … … 742 742 * @param firstc First cluster in the chain which is to be freed. 743 743 * 744 * @return EOK on success or a negative returncode.745 */ 746 int744 * @return EOK on success or an error code. 745 */ 746 errno_t 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 int rc;752 errno_t rc; 753 753 754 754 /* Mark all clusters in the chain as free in all copies of FAT. */ … … 780 780 * @param lcl Last cluster of the cluster chain to append. 781 781 * 782 * @return EOK on success or a negativeerror code.783 */ 784 int fat_append_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl,782 * @return EOK on success or an error code. 783 */ 784 errno_t 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 int rc;790 errno_t rc; 791 791 792 792 if (nodep->firstc == FAT_CLST_RES0) { … … 827 827 * be chopped off. 828 828 * 829 * @return EOK on success or a negative returncode.830 */ 831 int fat_chop_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t lcl)829 * @return EOK on success or an error code. 830 */ 831 errno_t 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 int rc;834 errno_t rc; 835 835 service_id_t service_id = nodep->idx->service_id; 836 836 … … 880 880 } 881 881 882 int882 errno_t 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 int rc;887 errno_t rc; 888 888 889 889 for (i = 0; i < SPC(bs); i++) { … … 908 908 * does not contain a fat file system. 909 909 */ 910 int fat_sanity_check(fat_bs_t *bs, service_id_t service_id)910 errno_t 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 int rc;915 errno_t rc; 916 916 917 917 /* Check number of FATs. */
Note:
See TracChangeset
for help on using the changeset viewer.