Changeset 401b9e42 in mainline for uspace/srv/bd/hr/hr.c


Ignore:
Timestamp:
2025-01-12T21:53:55Z (6 months ago)
Author:
Miroslav Cimerman <mc@…>
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)
Message:

hr: state_changed and peding_invalidation atomic flags

These flags are used to check whether there was a state
change, or if there is a pending invalidation, so that
we can avoid the slow code paths in a lockless fashion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/hr.c

    re2b417f r401b9e42  
    264264
    265265        atomic_init(&new_volume->rebuild_blk, 0);
     266        atomic_init(&new_volume->state_changed, false);
     267        atomic_init(&new_volume->pending_invalidation, false);
    266268
    267269        rc = new_volume->hr_ops.create(new_volume);
     
    320322                fibril_rwlock_write_lock(&vol->states_lock);
    321323                fibril_rwlock_read_lock(&vol->extents_lock);
     324
     325                /* TODO: maybe expose extent state callbacks */
    322326                hr_update_ext_status(vol, fail_extent, HR_EXT_FAILED);
     327                atomic_store(&vol->state_changed, true);
     328
    323329                fibril_rwlock_read_unlock(&vol->extents_lock);
    324330                fibril_rwlock_write_unlock(&vol->states_lock);
Note: See TracChangeset for help on using the changeset viewer.