Changeset 10005fd in mainline
- Timestamp:
- 2025-03-06T20:13:51Z (3 months ago)
- Children:
- d6fe2a1
- Parents:
- 4d42a1b
- Location:
- uspace/srv/bd/hr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/hr.c
r4d42a1b r10005fd 249 249 fibril_mutex_initialize(&new_volume->lock); /* XXX: will remove this */ 250 250 251 fibril_mutex_initialize(&new_volume->halt_lock);252 new_volume->halt_please = false;253 254 251 fibril_rwlock_initialize(&new_volume->extents_lock); 255 252 fibril_rwlock_initialize(&new_volume->states_lock); -
uspace/srv/bd/hr/raid1.c
r4d42a1b r10005fd 344 344 345 345 /* 346 * this is to allow adding hotspare or start a rebuild on347 * very busy array, because of how rwlocks are implemented348 * in HelenOS (no writer priority, so if there are multiple349 * continuos readers, writer will never own the lock)350 */351 if (vol->halt_please) {352 fibril_mutex_lock(&vol->halt_lock);353 fibril_mutex_unlock(&vol->halt_lock);354 }355 356 /*357 346 * extent order has to be locked for the whole IO duration, 358 347 * so that workers have consistent targets … … 591 580 errno_t rc = EOK; 592 581 593 fibril_mutex_lock(&vol->halt_lock);594 vol->halt_please = true;595 582 fibril_rwlock_write_lock(&vol->extents_lock); 596 583 fibril_rwlock_write_lock(&vol->states_lock); … … 651 638 fibril_rwlock_write_unlock(&vol->states_lock); 652 639 fibril_rwlock_write_unlock(&vol->extents_lock); 653 vol->halt_please = false;654 fibril_mutex_unlock(&vol->halt_lock);655 640 656 641 return rc; -
uspace/srv/bd/hr/var.h
r4d42a1b r10005fd 106 106 fibril_rwlock_t states_lock; 107 107 108 /* for halting IO requests when a REBUILD start waits */109 bool halt_please;110 fibril_mutex_t halt_lock;111 112 108 _Atomic bool state_changed; 113 109 _Atomic uint64_t rebuild_blk;
Note:
See TracChangeset
for help on using the changeset viewer.