Changeset 8c76c30 in mainline
- Timestamp:
- 2011-03-20T12:50:04Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4611094f
- Parents:
- 6adba0a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_read.c
r6adba0a8 r8c76c30 72 72 { 73 73 block_t *bi1, *bi2; 74 int r, nr_direct , nr_indirect;74 int r, nr_direct; 75 75 int ptrs_per_block; 76 76 … … 88 88 if (fs_version == MFS_VERSION_V1) { 89 89 nr_direct = V1_NR_DIRECT_ZONES; 90 nr_indirect = V1_NR_INDIRECT_ZONES;91 90 ptrs_per_block = MFS_BLOCKSIZE / sizeof(uint16_t); 92 91 } else { 93 92 nr_direct = V2_NR_DIRECT_ZONES; 94 nr_indirect = V2_NR_INDIRECT_ZONES;95 93 ptrs_per_block = sbi->block_size / sizeof(uint32_t); 96 94 } 97 95 96 /*Check if the wanted block is in the direct zones*/ 98 97 if (rblock < nr_direct) { 99 98 *b = ino_i->i_dzone[rblock]; … … 103 102 rblock -= nr_direct - 1; 104 103 105 /*Check if the wanted block is in the single indirect zone*/106 104 if (rblock < ptrs_per_block) { 105 /*The wanted block is in the single indirect zone chain*/ 107 106 if (ino_i->i_izone[0] == 0) { 108 107 r = -1; … … 123 122 rblock -= ptrs_per_block - 1; 124 123 125 /*The wanted block is in the double indirect zone*/ 126 uint32_t di_block = rblock / ptrs_per_block; 124 /*The wanted block is in the double indirect zone chain*/ 127 125 128 /*read the first indirect zone */126 /*read the first indirect zone of the chain*/ 129 127 if (ino_i->i_izone[1] == 0) { 130 128 r = -1; 131 129 goto out; 132 130 } 133 134 131 r = read_ind_block(bi1, mnode->instance, ino_i->i_izone[1]); 135 132 … … 137 134 goto out; 138 135 139 /*read the second indirect zone*/ 136 /* 137 *Compute the position of the second indirect 138 *zone pointer in the chain. 139 */ 140 uint32_t di_block = rblock / ptrs_per_block; 141 142 /*read the second indirect zone of the chain*/ 140 143 if (fs_version == MFS_VERSION_V1) { 141 144 r = read_ind_block(bi2, mnode->instance, … … 155 158 *b = ((uint32_t *) bi2->data)[rblock % ptrs_per_block]; 156 159 } 160 r = EOK; 157 161 block_put(bi2); 158 162
Note:
See TracChangeset
for help on using the changeset viewer.