Changeset ee47537 in mainline
- Timestamp:
- 2025-01-12T16:12:38Z (5 months ago)
- Children:
- 58d82fa
- Parents:
- 4660649
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/raid0.c
r4660649 ree47537 55 55 extern loc_srv_t *hr_srv; 56 56 57 static errno_thr_raid0_update_vol_status(hr_volume_t *);57 static void hr_raid0_update_vol_status(hr_volume_t *); 58 58 static errno_t hr_raid0_bd_op(hr_bd_op_type_t, bd_srv_t *, aoff64_t, size_t, 59 59 void *, const void *, size_t); … … 91 91 } 92 92 93 rc = hr_raid0_update_vol_status(new_volume); 94 if (rc != EOK) 95 return rc; 96 97 hr_update_vol_status(new_volume, HR_VOL_ONLINE); 93 hr_raid0_update_vol_status(new_volume); 94 if (new_volume->status != HR_VOL_ONLINE) 95 return EINVAL; 98 96 99 97 bd_srvs_init(&new_volume->hr_bds); … … 129 127 void hr_raid0_status_event(hr_volume_t *vol) 130 128 { 131 (void)hr_raid0_update_vol_status(vol);129 hr_raid0_update_vol_status(vol); 132 130 } 133 131 … … 177 175 } 178 176 179 /* 180 * Update vol->status and return EOK if volume 181 * is usable 182 */ 183 static errno_t hr_raid0_update_vol_status(hr_volume_t *vol) 177 static void hr_raid0_update_vol_status(hr_volume_t *vol) 184 178 { 185 179 fibril_rwlock_read_lock(&vol->states_lock); 180 186 181 hr_vol_status_t old_state = vol->status; 187 182 … … 189 184 if (vol->extents[i].status != HR_EXT_ONLINE) { 190 185 fibril_rwlock_read_unlock(&vol->states_lock); 191 fibril_rwlock_write_lock(&vol->states_lock); 192 if (old_state != HR_VOL_FAULTY) 186 187 if (old_state != HR_VOL_FAULTY) { 188 fibril_rwlock_write_lock(&vol->states_lock); 193 189 hr_update_vol_status(vol, HR_VOL_FAULTY); 194 fibril_rwlock_write_unlock(&vol->states_lock); 195 return EIO; 190 fibril_rwlock_write_unlock(&vol->states_lock); 191 } 192 return; 196 193 } 197 194 } 198 195 fibril_rwlock_read_unlock(&vol->states_lock); 199 196 200 return EOK; 197 if (old_state != HR_VOL_ONLINE) { 198 fibril_rwlock_write_lock(&vol->states_lock); 199 hr_update_vol_status(vol, HR_VOL_ONLINE); 200 fibril_rwlock_write_unlock(&vol->states_lock); 201 } 201 202 } 202 203
Note:
See TracChangeset
for help on using the changeset viewer.