Changes in uspace/srv/fs/mfs/mfs_rw.c [95027b5:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_rw.c
r95027b5 r9d58539 104 104 bool write_mode, uint32_t w_block) 105 105 { 106 int nr_direct;106 int r, nr_direct; 107 107 int ptrs_per_block; 108 uint32_t *ind_zone = NULL, *ind2_zone = NULL; 109 int r = EOK; 108 uint32_t *ind_zone, *ind2_zone; 110 109 111 110 struct mfs_ino_info *ino_i = mnode->ino_i; … … 131 130 ino_i->dirty = true; 132 131 } 133 goto out;132 return EOK; 134 133 } 135 134 … … 143 142 r = alloc_zone_and_clear(inst, &zone); 144 143 if (r != EOK) 145 goto out;144 return r; 146 145 147 146 ino_i->i_izone[0] = zone; … … 150 149 /* Sparse block */ 151 150 *b = 0; 152 goto out;151 return EOK; 153 152 } 154 153 } … … 156 155 r = read_ind_zone(inst, ino_i->i_izone[0], &ind_zone); 157 156 if (r != EOK) 158 goto out;157 return r; 159 158 160 159 *b = ind_zone[rblock]; … … 164 163 } 165 164 166 goto out ;165 goto out_free_ind1; 167 166 } 168 167 … … 177 176 r = alloc_zone_and_clear(inst, &zone); 178 177 if (r != EOK) 179 goto out;178 return r; 180 179 181 180 ino_i->i_izone[1] = zone; … … 184 183 /* Sparse block */ 185 184 *b = 0; 186 goto out;185 return EOK; 187 186 } 188 187 } … … 190 189 r = read_ind_zone(inst, ino_i->i_izone[1], &ind_zone); 191 190 if (r != EOK) 192 goto out;191 return r; 193 192 194 193 /* … … 204 203 r = alloc_zone_and_clear(inst, &zone); 205 204 if (r != EOK) 206 goto out ;205 goto out_free_ind1; 207 206 208 207 ind_zone[ind2_off] = zone; … … 210 209 } else { 211 210 /* Sparse block */ 211 r = EOK; 212 212 *b = 0; 213 goto out ;213 goto out_free_ind1; 214 214 } 215 215 } … … 217 217 r = read_ind_zone(inst, ind_zone[ind2_off], &ind2_zone); 218 218 if (r != EOK) 219 goto out ;219 goto out_free_ind1; 220 220 221 221 *b = ind2_zone[rblock - (ind2_off * ptrs_per_block)]; … … 225 225 } 226 226 227 out: 227 r = EOK; 228 228 229 free(ind2_zone); 230 out_free_ind1: 229 231 free(ind_zone); 230 232 return r;
Note:
See TracChangeset
for help on using the changeset viewer.