Changeset 401b9e42 in mainline for uspace/srv/bd/hr/raid1.c
- Timestamp:
- 2025-01-12T21:53:55Z (5 months ago)
- Children:
- dec4150
- Parents:
- e2b417f
- git-author:
- Miroslav Cimerman <mc@…> (2025-01-12 19:18:08)
- git-committer:
- Miroslav Cimerman <mc@…> (2025-01-12 21:53:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/raid1.c
re2b417f r401b9e42 103 103 new_volume->hr_bds.sarg = new_volume; 104 104 105 /* force volume state update */ 106 atomic_store(&new_volume->state_changed, true); 105 107 hr_raid1_update_vol_status(new_volume); 106 108 if (new_volume->status == HR_VOL_FAULTY) … … 275 277 static void hr_raid1_update_vol_status(hr_volume_t *vol) 276 278 { 277 fibril_mutex_lock(&vol->deferred_list_lock); 278 279 if (list_count(&vol->deferred_invalidations_list) > 0) 279 bool exp = true; 280 281 if (!atomic_compare_exchange_strong(&vol->state_changed, &exp, false)) 282 return; 283 284 if (atomic_compare_exchange_strong(&vol->pending_invalidation, &exp, 285 false)) { 286 fibril_mutex_lock(&vol->deferred_list_lock); 280 287 process_deferred_invalidations(vol); 281 282 fibril_mutex_unlock(&vol->deferred_list_lock);288 fibril_mutex_unlock(&vol->deferred_list_lock); 289 } 283 290 284 291 fibril_rwlock_read_lock(&vol->extents_lock); … … 344 351 assert(vol->extents[extent].status == 345 352 HR_EXT_INVALID); 346 goto d one;353 goto deferring_end; 347 354 } 348 355 } … … 358 365 list_append(&vol->deferred_inval[i].link, 359 366 &vol->deferred_invalidations_list); 360 done: 367 368 atomic_store(&vol->pending_invalidation, true); 369 deferring_end: 370 361 371 fibril_mutex_unlock(&vol->deferred_list_lock); 362 372 break; … … 367 377 hr_update_ext_status(vol, extent, HR_EXT_FAILED); 368 378 } 379 380 atomic_store(&vol->state_changed, true); 369 381 370 382 fibril_rwlock_write_unlock(&vol->states_lock);
Note:
See TracChangeset
for help on using the changeset viewer.