Changes in uspace/srv/fs/exfat/exfat_ops.c [b7fd2a0:38d150e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_ops.c
rb7fd2a0 r38d150e 72 72 */ 73 73 74 static errno_t exfat_root_get(fs_node_t **, service_id_t);75 static errno_t exfat_match(fs_node_t **, fs_node_t *, const char *);76 static errno_t exfat_node_get(fs_node_t **, service_id_t, fs_index_t);77 static errno_t exfat_node_open(fs_node_t *);78 /* static errno_t exfat_node_put(fs_node_t *); */79 static errno_t exfat_create_node(fs_node_t **, service_id_t, int);80 static errno_t exfat_destroy_node(fs_node_t *);81 static errno_t exfat_link(fs_node_t *, fs_node_t *, const char *);82 static errno_t exfat_unlink(fs_node_t *, fs_node_t *, const char *);83 static errno_t exfat_has_children(bool *, fs_node_t *);74 static int exfat_root_get(fs_node_t **, service_id_t); 75 static int exfat_match(fs_node_t **, fs_node_t *, const char *); 76 static int exfat_node_get(fs_node_t **, service_id_t, fs_index_t); 77 static int exfat_node_open(fs_node_t *); 78 /* static int exfat_node_put(fs_node_t *); */ 79 static int exfat_create_node(fs_node_t **, service_id_t, int); 80 static int exfat_destroy_node(fs_node_t *); 81 static int exfat_link(fs_node_t *, fs_node_t *, const char *); 82 static int exfat_unlink(fs_node_t *, fs_node_t *, const char *); 83 static int exfat_has_children(bool *, fs_node_t *); 84 84 static fs_index_t exfat_index_get(fs_node_t *); 85 85 static aoff64_t exfat_size_get(fs_node_t *); … … 88 88 static bool exfat_is_file(fs_node_t *node); 89 89 static service_id_t exfat_service_get(fs_node_t *node); 90 static errno_t exfat_size_block(service_id_t, uint32_t *);91 static errno_t exfat_total_block_count(service_id_t, uint64_t *);92 static errno_t exfat_free_block_count(service_id_t, uint64_t *);90 static int exfat_size_block(service_id_t, uint32_t *); 91 static int exfat_total_block_count(service_id_t, uint64_t *); 92 static int exfat_free_block_count(service_id_t, uint64_t *); 93 93 94 94 /* … … 114 114 } 115 115 116 static errno_t exfat_node_sync(exfat_node_t *node)117 { 118 errno_t rc;116 static int exfat_node_sync(exfat_node_t *node) 117 { 118 int rc; 119 119 exfat_directory_t di; 120 120 exfat_file_dentry_t df; … … 155 155 } 156 156 157 static errno_t exfat_node_fini_by_service_id(service_id_t service_id)158 { 159 errno_t rc;157 static int exfat_node_fini_by_service_id(service_id_t service_id) 158 { 159 int rc; 160 160 161 161 /* … … 211 211 } 212 212 213 static errno_t exfat_node_get_new(exfat_node_t **nodepp)213 static int exfat_node_get_new(exfat_node_t **nodepp) 214 214 { 215 215 fs_node_t *fn; 216 216 exfat_node_t *nodep; 217 errno_t rc;217 int rc; 218 218 219 219 fibril_mutex_lock(&ffn_mutex); … … 269 269 } 270 270 271 static errno_t exfat_node_get_new_by_pos(exfat_node_t **nodepp,271 static int exfat_node_get_new_by_pos(exfat_node_t **nodepp, 272 272 service_id_t service_id, exfat_cluster_t pfc, unsigned pdi) 273 273 { … … 287 287 * @param idxp Locked index structure. 288 288 */ 289 static errno_t exfat_node_get_core(exfat_node_t **nodepp, exfat_idx_t *idxp)289 static int exfat_node_get_core(exfat_node_t **nodepp, exfat_idx_t *idxp) 290 290 { 291 291 exfat_dentry_t *d; 292 292 exfat_node_t *nodep = NULL; 293 293 exfat_directory_t di; 294 errno_t rc;294 int rc; 295 295 296 296 if (idxp->nodep) { … … 398 398 } 399 399 400 errno_t exfat_node_expand(service_id_t service_id, exfat_node_t *nodep,400 int exfat_node_expand(service_id_t service_id, exfat_node_t *nodep, 401 401 exfat_cluster_t clusters) 402 402 { 403 403 exfat_bs_t *bs; 404 errno_t rc;404 int rc; 405 405 bs = block_bb_get(service_id); 406 406 … … 443 443 } 444 444 445 static errno_t exfat_node_shrink(service_id_t service_id, exfat_node_t *nodep,445 static int exfat_node_shrink(service_id_t service_id, exfat_node_t *nodep, 446 446 aoff64_t size) 447 447 { 448 448 exfat_bs_t *bs; 449 errno_t rc;449 int rc; 450 450 bs = block_bb_get(service_id); 451 451 … … 491 491 */ 492 492 493 errno_t exfat_root_get(fs_node_t **rfn, service_id_t service_id)493 int exfat_root_get(fs_node_t **rfn, service_id_t service_id) 494 494 { 495 495 return exfat_node_get(rfn, service_id, EXFAT_ROOT_IDX); 496 496 } 497 497 498 errno_t exfat_bitmap_get(fs_node_t **rfn, service_id_t service_id)498 int exfat_bitmap_get(fs_node_t **rfn, service_id_t service_id) 499 499 { 500 500 return exfat_node_get(rfn, service_id, EXFAT_BITMAP_IDX); 501 501 } 502 502 503 errno_t exfat_uctable_get(fs_node_t **rfn, service_id_t service_id)503 int exfat_uctable_get(fs_node_t **rfn, service_id_t service_id) 504 504 { 505 505 return exfat_node_get(rfn, service_id, EXFAT_UCTABLE_IDX); … … 507 507 508 508 509 errno_t exfat_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)509 int exfat_match(fs_node_t **rfn, fs_node_t *pfn, const char *component) 510 510 { 511 511 exfat_node_t *parentp = EXFAT_NODE(pfn); … … 514 514 exfat_stream_dentry_t ds; 515 515 service_id_t service_id; 516 errno_t rc;516 int rc; 517 517 518 518 fibril_mutex_lock(&parentp->idx->lock); … … 565 565 566 566 /** Instantiate a exFAT in-core node. */ 567 errno_t exfat_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index)567 int exfat_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index) 568 568 { 569 569 exfat_node_t *nodep; 570 570 exfat_idx_t *idxp; 571 errno_t rc;571 int rc; 572 572 573 573 idxp = exfat_idx_get_by_index(service_id, index); … … 584 584 } 585 585 586 errno_t exfat_node_open(fs_node_t *fn)586 int exfat_node_open(fs_node_t *fn) 587 587 { 588 588 /* … … 593 593 } 594 594 595 errno_t exfat_node_put(fs_node_t *fn)595 int exfat_node_put(fs_node_t *fn) 596 596 { 597 597 if (fn == NULL) … … 625 625 } 626 626 627 errno_t exfat_create_node(fs_node_t **rfn, service_id_t service_id, int flags)627 int exfat_create_node(fs_node_t **rfn, service_id_t service_id, int flags) 628 628 { 629 629 exfat_idx_t *idxp; 630 630 exfat_node_t *nodep; 631 631 exfat_bs_t *bs; 632 errno_t rc;632 int rc; 633 633 634 634 bs = block_bb_get(service_id); … … 677 677 } 678 678 679 errno_t exfat_destroy_node(fs_node_t *fn)679 int exfat_destroy_node(fs_node_t *fn) 680 680 { 681 681 exfat_node_t *nodep = EXFAT_NODE(fn); 682 682 exfat_bs_t *bs; 683 683 bool has_children; 684 errno_t rc;684 int rc; 685 685 686 686 /* … … 718 718 } 719 719 720 errno_t exfat_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)720 int exfat_link(fs_node_t *pfn, fs_node_t *cfn, const char *name) 721 721 { 722 722 exfat_node_t *parentp = EXFAT_NODE(pfn); 723 723 exfat_node_t *childp = EXFAT_NODE(cfn); 724 724 exfat_directory_t di; 725 errno_t rc;725 int rc; 726 726 727 727 fibril_mutex_lock(&childp->lock); … … 783 783 } 784 784 785 errno_t exfat_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *nm)785 int exfat_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *nm) 786 786 { 787 787 exfat_node_t *parentp = EXFAT_NODE(pfn); 788 788 exfat_node_t *childp = EXFAT_NODE(cfn); 789 789 bool has_children; 790 errno_t rc;790 int rc; 791 791 792 792 if (!parentp) … … 838 838 } 839 839 840 errno_t exfat_has_children(bool *has_children, fs_node_t *fn)840 int exfat_has_children(bool *has_children, fs_node_t *fn) 841 841 { 842 842 exfat_directory_t di; 843 843 exfat_dentry_t *d; 844 844 exfat_node_t *nodep = EXFAT_NODE(fn); 845 errno_t rc;845 int rc; 846 846 847 847 *has_children = false; … … 915 915 } 916 916 917 errno_t exfat_size_block(service_id_t service_id, uint32_t *size)917 int exfat_size_block(service_id_t service_id, uint32_t *size) 918 918 { 919 919 exfat_bs_t *bs; … … 924 924 } 925 925 926 errno_t exfat_total_block_count(service_id_t service_id, uint64_t *count)926 int exfat_total_block_count(service_id_t service_id, uint64_t *count) 927 927 { 928 928 exfat_bs_t *bs; … … 933 933 } 934 934 935 errno_t exfat_free_block_count(service_id_t service_id, uint64_t *count)935 int exfat_free_block_count(service_id_t service_id, uint64_t *count) 936 936 { 937 937 fs_node_t *node = NULL; … … 941 941 uint64_t block_count; 942 942 unsigned sector; 943 errno_t rc;943 int rc; 944 944 945 945 rc = exfat_total_block_count(service_id, &block_count); … … 1015 1015 }; 1016 1016 1017 static errno_t exfat_fs_open(service_id_t service_id, enum cache_mode cmode,1017 static int exfat_fs_open(service_id_t service_id, enum cache_mode cmode, 1018 1018 fs_node_t **rrfn, exfat_idx_t **rridxp, vfs_fs_probe_info_t *info) 1019 1019 { 1020 errno_t rc;1020 int rc; 1021 1021 exfat_node_t *rootp = NULL, *bitmapp = NULL, *uctablep = NULL; 1022 1022 exfat_bs_t *bs; … … 1267 1267 */ 1268 1268 1269 static errno_t exfat_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info)1270 { 1271 errno_t rc;1269 static int exfat_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info) 1270 { 1271 int rc; 1272 1272 exfat_idx_t *ridxp; 1273 1273 fs_node_t *rfn; … … 1281 1281 } 1282 1282 1283 static errno_t1283 static int 1284 1284 exfat_mounted(service_id_t service_id, const char *opts, fs_index_t *index, 1285 1285 aoff64_t *size) 1286 1286 { 1287 errno_t rc;1287 int rc; 1288 1288 enum cache_mode cmode; 1289 1289 exfat_idx_t *ridxp; … … 1306 1306 } 1307 1307 1308 static errno_t exfat_unmounted(service_id_t service_id)1308 static int exfat_unmounted(service_id_t service_id) 1309 1309 { 1310 1310 fs_node_t *rfn; 1311 errno_t rc;1311 int rc; 1312 1312 1313 1313 rc = exfat_root_get(&rfn, service_id); … … 1319 1319 } 1320 1320 1321 static errno_t1321 static int 1322 1322 exfat_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 1323 1323 size_t *rbytes) … … 1328 1328 size_t bytes = 0; 1329 1329 block_t *b; 1330 errno_t rc;1330 int rc; 1331 1331 1332 1332 rc = exfat_node_get(&fn, service_id, index); … … 1438 1438 } 1439 1439 1440 static errno_t exfat_close(service_id_t service_id, fs_index_t index)1441 { 1442 return EOK; 1443 } 1444 1445 static errno_t exfat_sync(service_id_t service_id, fs_index_t index)1440 static int exfat_close(service_id_t service_id, fs_index_t index) 1441 { 1442 return EOK; 1443 } 1444 1445 static int exfat_sync(service_id_t service_id, fs_index_t index) 1446 1446 { 1447 1447 fs_node_t *fn; 1448 errno_t rc = exfat_node_get(&fn, service_id, index);1448 int rc = exfat_node_get(&fn, service_id, index); 1449 1449 if (rc != EOK) 1450 1450 return rc; … … 1461 1461 } 1462 1462 1463 static errno_t1463 static int 1464 1464 exfat_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 1465 1465 size_t *wbytes, aoff64_t *nsize) … … 1472 1472 aoff64_t boundary; 1473 1473 int flags = BLOCK_FLAGS_NONE; 1474 errno_t rc;1474 int rc; 1475 1475 1476 1476 rc = exfat_node_get(&fn, service_id, index); … … 1548 1548 } 1549 1549 1550 static errno_t1550 static int 1551 1551 exfat_truncate(service_id_t service_id, fs_index_t index, aoff64_t size) 1552 1552 { … … 1554 1554 exfat_node_t *nodep; 1555 1555 exfat_bs_t *bs; 1556 errno_t rc;1556 int rc; 1557 1557 1558 1558 rc = exfat_node_get(&fn, service_id, index); … … 1584 1584 } 1585 1585 1586 errno_t rc2 = exfat_node_put(fn);1586 int rc2 = exfat_node_put(fn); 1587 1587 if (rc == EOK && rc2 != EOK) 1588 1588 rc = rc2; … … 1591 1591 } 1592 1592 1593 static errno_t exfat_destroy(service_id_t service_id, fs_index_t index)1593 static int exfat_destroy(service_id_t service_id, fs_index_t index) 1594 1594 { 1595 1595 fs_node_t *fn; 1596 1596 exfat_node_t *nodep; 1597 errno_t rc;1597 int rc; 1598 1598 1599 1599 rc = exfat_node_get(&fn, service_id, index);
Note:
See TracChangeset
for help on using the changeset viewer.