Changes in uspace/srv/fs/cdfs/cdfs_ops.c [b7fd2a0:94e3a03] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/cdfs/cdfs_ops.c
rb7fd2a0 r94e3a03 331 331 }; 332 332 333 static errno_t cdfs_node_get(fs_node_t **rfn, service_id_t service_id,333 static int cdfs_node_get(fs_node_t **rfn, service_id_t service_id, 334 334 fs_index_t index) 335 335 { … … 351 351 } 352 352 353 static errno_t cdfs_root_get(fs_node_t **rfn, service_id_t service_id)353 static int cdfs_root_get(fs_node_t **rfn, service_id_t service_id) 354 354 { 355 355 return cdfs_node_get(rfn, service_id, CDFS_SOME_ROOT); … … 371 371 } 372 372 373 static errno_t create_node(fs_node_t **rfn, cdfs_t *fs, int lflag,373 static int create_node(fs_node_t **rfn, cdfs_t *fs, int lflag, 374 374 fs_index_t index) 375 375 { … … 392 392 393 393 fs_node_t *rootfn; 394 errno_t rc = cdfs_root_get(&rootfn, fs->service_id);394 int rc = cdfs_root_get(&rootfn, fs->service_id); 395 395 396 396 assert(rc == EOK); … … 417 417 } 418 418 419 static errno_t link_node(fs_node_t *pfn, fs_node_t *fn, const char *name)419 static int link_node(fs_node_t *pfn, fs_node_t *fn, const char *name) 420 420 { 421 421 cdfs_node_t *parent = CDFS_NODE(pfn); … … 460 460 static char *cdfs_decode_str(void *data, size_t dsize, cdfs_enc_t enc) 461 461 { 462 errno_t rc;462 int rc; 463 463 char *str; 464 464 uint16_t *buf; … … 566 566 } 567 567 568 static errno_t cdfs_readdir(cdfs_t *fs, fs_node_t *fs_node)568 static int cdfs_readdir(cdfs_t *fs, fs_node_t *fs_node) 569 569 { 570 570 cdfs_node_t *node = CDFS_NODE(fs_node); … … 580 580 for (uint32_t i = 0; i < blocks; i++) { 581 581 block_t *block; 582 errno_t rc = block_get(&block, fs->service_id, node->lba + i, BLOCK_FLAGS_NONE);582 int rc = block_get(&block, fs->service_id, node->lba + i, BLOCK_FLAGS_NONE); 583 583 if (rc != EOK) 584 584 return rc; … … 614 614 615 615 fs_node_t *fn; 616 errno_t rc = create_node(&fn, fs, dentry_type,616 int rc = create_node(&fn, fs, dentry_type, 617 617 (node->lba + i) * BLOCK_SIZE + offset); 618 618 if (rc != EOK) … … 652 652 653 653 block_t *block; 654 errno_t rc = block_get(&block, fs->service_id, lba, BLOCK_FLAGS_NONE);654 int rc = block_get(&block, fs->service_id, lba, BLOCK_FLAGS_NONE); 655 655 if (rc != EOK) 656 656 return NULL; … … 698 698 } 699 699 700 static errno_t cdfs_match(fs_node_t **fn, fs_node_t *pfn, const char *component)700 static int cdfs_match(fs_node_t **fn, fs_node_t *pfn, const char *component) 701 701 { 702 702 cdfs_node_t *parent = CDFS_NODE(pfn); 703 703 704 704 if (!parent->processed) { 705 errno_t rc = cdfs_readdir(parent->fs, pfn);705 int rc = cdfs_readdir(parent->fs, pfn); 706 706 if (rc != EOK) 707 707 return rc; … … 719 719 } 720 720 721 static errno_t cdfs_node_open(fs_node_t *fn)721 static int cdfs_node_open(fs_node_t *fn) 722 722 { 723 723 cdfs_node_t *node = CDFS_NODE(fn); … … 730 730 } 731 731 732 static errno_t cdfs_node_put(fs_node_t *fn)732 static int cdfs_node_put(fs_node_t *fn) 733 733 { 734 734 /* Nothing to do */ … … 736 736 } 737 737 738 static errno_t cdfs_create_node(fs_node_t **fn, service_id_t service_id, int lflag)738 static int cdfs_create_node(fs_node_t **fn, service_id_t service_id, int lflag) 739 739 { 740 740 /* Read-only */ … … 742 742 } 743 743 744 static errno_t cdfs_destroy_node(fs_node_t *fn)744 static int cdfs_destroy_node(fs_node_t *fn) 745 745 { 746 746 /* Read-only */ … … 748 748 } 749 749 750 static errno_t cdfs_link_node(fs_node_t *pfn, fs_node_t *cfn, const char *name)750 static int cdfs_link_node(fs_node_t *pfn, fs_node_t *cfn, const char *name) 751 751 { 752 752 /* Read-only */ … … 754 754 } 755 755 756 static errno_t cdfs_unlink_node(fs_node_t *pfn, fs_node_t *cfn, const char *name)756 static int cdfs_unlink_node(fs_node_t *pfn, fs_node_t *cfn, const char *name) 757 757 { 758 758 /* Read-only */ … … 760 760 } 761 761 762 static errno_t cdfs_has_children(bool *has_children, fs_node_t *fn)762 static int cdfs_has_children(bool *has_children, fs_node_t *fn) 763 763 { 764 764 cdfs_node_t *node = CDFS_NODE(fn); … … 806 806 } 807 807 808 static errno_t cdfs_size_block(service_id_t service_id, uint32_t *size)808 static int cdfs_size_block(service_id_t service_id, uint32_t *size) 809 809 { 810 810 *size = BLOCK_SIZE; … … 813 813 } 814 814 815 static errno_t cdfs_total_block_count(service_id_t service_id, uint64_t *count)815 static int cdfs_total_block_count(service_id_t service_id, uint64_t *count) 816 816 { 817 817 *count = 0; … … 820 820 } 821 821 822 static errno_t cdfs_free_block_count(service_id_t service_id, uint64_t *count)822 static int cdfs_free_block_count(service_id_t service_id, uint64_t *count) 823 823 { 824 824 *count = 0; … … 851 851 /** Verify that escape sequence corresonds to one of the allowed encoding 852 852 * escape sequences allowed for Joliet. */ 853 static errno_t cdfs_verify_joliet_esc_seq(uint8_t *seq)853 static int cdfs_verify_joliet_esc_seq(uint8_t *seq) 854 854 { 855 855 size_t i, j, k; … … 895 895 * @return EOK if found, ENOENT if not 896 896 */ 897 static errno_t cdfs_find_joliet_svd(service_id_t sid, cdfs_lba_t altroot,897 static int cdfs_find_joliet_svd(service_id_t sid, cdfs_lba_t altroot, 898 898 uint32_t *rlba, uint32_t *rsize, char **vol_ident) 899 899 { … … 902 902 for (bi = altroot + 17; ; bi++) { 903 903 block_t *block; 904 errno_t rc = block_get(&block, sid, bi, BLOCK_FLAGS_NONE);904 int rc = block_get(&block, sid, bi, BLOCK_FLAGS_NONE); 905 905 if (rc != EOK) 906 906 break; … … 963 963 964 964 /** Read the volume descriptors. */ 965 static errno_t iso_read_vol_desc(service_id_t sid, cdfs_lba_t altroot,965 static int iso_read_vol_desc(service_id_t sid, cdfs_lba_t altroot, 966 966 uint32_t *rlba, uint32_t *rsize, cdfs_enc_t *enc, char **vol_ident) 967 967 { 968 968 /* First 16 blocks of isofs are empty */ 969 969 block_t *block; 970 errno_t rc = block_get(&block, sid, altroot + 16, BLOCK_FLAGS_NONE);970 int rc = block_get(&block, sid, altroot + 16, BLOCK_FLAGS_NONE); 971 971 if (rc != EOK) 972 972 return rc; … … 1036 1036 } 1037 1037 1038 static errno_t iso_readfs(cdfs_t *fs, fs_node_t *rfn,1038 static int iso_readfs(cdfs_t *fs, fs_node_t *rfn, 1039 1039 cdfs_lba_t altroot) 1040 1040 { 1041 1041 cdfs_node_t *node = CDFS_NODE(rfn); 1042 1042 1043 errno_t rc = iso_read_vol_desc(fs->service_id, altroot, &node->lba,1043 int rc = iso_read_vol_desc(fs->service_id, altroot, &node->lba, 1044 1044 &node->size, &fs->enc, &fs->vol_ident); 1045 1045 if (rc != EOK) … … 1064 1064 1065 1065 /* Create root node */ 1066 errno_t rc = create_node(&rfn, fs, L_DIRECTORY, cdfs_index++);1066 int rc = create_node(&rfn, fs, L_DIRECTORY, cdfs_index++); 1067 1067 1068 1068 if ((rc != EOK) || (!rfn)) … … 1086 1086 } 1087 1087 1088 static errno_t cdfs_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info)1088 static int cdfs_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info) 1089 1089 { 1090 1090 char *vol_ident; 1091 1091 1092 1092 /* Initialize the block layer */ 1093 errno_t rc = block_init(service_id, BLOCK_SIZE);1093 int rc = block_init(service_id, BLOCK_SIZE); 1094 1094 if (rc != EOK) 1095 1095 return rc; … … 1144 1144 } 1145 1145 1146 static errno_t cdfs_mounted(service_id_t service_id, const char *opts,1146 static int cdfs_mounted(service_id_t service_id, const char *opts, 1147 1147 fs_index_t *index, aoff64_t *size) 1148 1148 { 1149 1149 /* Initialize the block layer */ 1150 errno_t rc = block_init(service_id, BLOCK_SIZE);1150 int rc = block_init(service_id, BLOCK_SIZE); 1151 1151 if (rc != EOK) 1152 1152 return rc; … … 1238 1238 } 1239 1239 1240 static errno_t cdfs_unmounted(service_id_t service_id)1240 static int cdfs_unmounted(service_id_t service_id) 1241 1241 { 1242 1242 cdfs_t *fs; … … 1250 1250 } 1251 1251 1252 static errno_t cdfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos,1252 static int cdfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 1253 1253 size_t *rbytes) 1254 1254 { … … 1266 1266 1267 1267 if (!node->processed) { 1268 errno_t rc = cdfs_readdir(node->fs, FS_NODE(node));1268 int rc = cdfs_readdir(node->fs, FS_NODE(node)); 1269 1269 if (rc != EOK) 1270 1270 return rc; … … 1290 1290 1291 1291 block_t *block; 1292 errno_t rc = block_get(&block, service_id, node->lba + lba,1292 int rc = block_get(&block, service_id, node->lba + lba, 1293 1293 BLOCK_FLAGS_NONE); 1294 1294 if (rc != EOK) { … … 1321 1321 } 1322 1322 1323 static errno_t cdfs_write(service_id_t service_id, fs_index_t index, aoff64_t pos,1323 static int cdfs_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 1324 1324 size_t *wbytes, aoff64_t *nsize) 1325 1325 { … … 1332 1332 } 1333 1333 1334 static errno_t cdfs_truncate(service_id_t service_id, fs_index_t index,1334 static int cdfs_truncate(service_id_t service_id, fs_index_t index, 1335 1335 aoff64_t size) 1336 1336 { … … 1373 1373 } 1374 1374 1375 static errno_t cdfs_close(service_id_t service_id, fs_index_t index)1375 static int cdfs_close(service_id_t service_id, fs_index_t index) 1376 1376 { 1377 1377 /* Root node is always in memory */ … … 1399 1399 } 1400 1400 1401 static errno_t cdfs_destroy(service_id_t service_id, fs_index_t index)1401 static int cdfs_destroy(service_id_t service_id, fs_index_t index) 1402 1402 { 1403 1403 /* … … 1409 1409 } 1410 1410 1411 static errno_t cdfs_sync(service_id_t service_id, fs_index_t index)1411 static int cdfs_sync(service_id_t service_id, fs_index_t index) 1412 1412 { 1413 1413 /*
Note:
See TracChangeset
for help on using the changeset viewer.