Changeset 132ab5d1 in mainline for uspace/srv/fs/cdfs/cdfs_ops.c
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5a6cc679
- Parents:
- 8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/srv/fs/cdfs/cdfs_ops.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/cdfs/cdfs_ops.c
r8bfb163 r132ab5d1 42 42 #include <adt/hash_table.h> 43 43 #include <adt/hash.h> 44 #include <malloc.h>45 44 #include <mem.h> 46 45 #include <loc.h> … … 49 48 #include <block.h> 50 49 #include <scsi/mmc.h> 50 #include <stdlib.h> 51 51 #include <str.h> 52 52 #include <byteorder.h> … … 566 566 } 567 567 568 static boolcdfs_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); … … 572 572 573 573 if (node->processed) 574 return true;574 return EOK; 575 575 576 576 uint32_t blocks = node->size / BLOCK_SIZE; … … 582 582 int rc = block_get(&block, fs->service_id, node->lba + i, BLOCK_FLAGS_NONE); 583 583 if (rc != EOK) 584 return false;584 return rc; 585 585 586 586 cdfs_dir_t *dir; … … 616 616 int rc = create_node(&fn, fs, dentry_type, 617 617 (node->lba + i) * BLOCK_SIZE + offset); 618 if ((rc != EOK) || (fn == NULL)) 619 return false; 618 if (rc != EOK) 619 return rc; 620 621 assert(fn != NULL); 620 622 621 623 cdfs_node_t *cur = CDFS_NODE(fn); … … 626 628 dir->name_length, node->fs->enc, dentry_type); 627 629 if (name == NULL) 628 return false;630 return EIO; 629 631 630 632 // FIXME: check return value … … 641 643 642 644 node->processed = true; 643 return true;645 return EOK; 644 646 } 645 647 … … 961 963 962 964 /** Read the volume descriptors. */ 963 static booliso_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, 964 966 uint32_t *rlba, uint32_t *rsize, cdfs_enc_t *enc, char **vol_ident) 965 967 { … … 968 970 int rc = block_get(&block, sid, altroot + 16, BLOCK_FLAGS_NONE); 969 971 if (rc != EOK) 970 return false;972 return rc; 971 973 972 974 cdfs_vol_desc_t *vol_desc = (cdfs_vol_desc_t *) block->data; … … 980 982 (vol_desc->version != 1)) { 981 983 block_put(block); 982 return false;984 return ENOTSUP; 983 985 } 984 986 … … 1000 1002 */ 1001 1003 block_put(block); 1002 return false;1004 return ENOTSUP; 1003 1005 } 1004 1006 … … 1006 1008 if (block_size != BLOCK_SIZE) { 1007 1009 block_put(block); 1008 return false;1010 return ENOTSUP; 1009 1011 } 1010 1012 … … 1031 1033 1032 1034 block_put(block); 1033 return true;1034 } 1035 1036 static booliso_readfs(cdfs_t *fs, fs_node_t *rfn,1035 return EOK; 1036 } 1037 1038 static int iso_readfs(cdfs_t *fs, fs_node_t *rfn, 1037 1039 cdfs_lba_t altroot) 1038 1040 { 1039 1041 cdfs_node_t *node = CDFS_NODE(rfn); 1040 1042 1041 if (!iso_read_vol_desc(fs->service_id, altroot, &node->lba, 1042 &node->size, &fs->enc, &fs->vol_ident)) 1043 return false; 1043 int rc = iso_read_vol_desc(fs->service_id, altroot, &node->lba, 1044 &node->size, &fs->enc, &fs->vol_ident); 1045 if (rc != EOK) 1046 return rc; 1044 1047 1045 1048 return cdfs_readdir(fs, rfn); … … 1072 1075 1073 1076 /* Check if there is cdfs in given session */ 1074 if ( !iso_readfs(fs, rfn, altroot))1077 if (iso_readfs(fs, rfn, altroot) != EOK) 1075 1078 goto error; 1076 1079 … … 1125 1128 uint32_t rsize; 1126 1129 cdfs_enc_t enc; 1127 if (!iso_read_vol_desc(service_id, altroot, &rlba, &rsize, &enc, 1128 &vol_ident)) { 1130 rc = iso_read_vol_desc(service_id, altroot, &rlba, &rsize, &enc, 1131 &vol_ident); 1132 if (rc != EOK) { 1129 1133 block_cache_fini(service_id); 1130 1134 block_fini(service_id); 1131 return EIO;1135 return rc; 1132 1136 } 1133 1137
Note:
See TracChangeset
for help on using the changeset viewer.
