Changeset 52be5fa in mainline


Ignore:
Timestamp:
2025-04-01T10:02:37Z (3 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
bbcd06e
Parents:
c7e6a3e
Message:

hr: increment metadata counter on volume assembly

For now increment the metadata counter right on assembly, but in the
future it can be deferred until the first write I/O comes our way,
to allow "read-only assembly" of volumes.

Location:
uspace/srv/bd/hr
Files:
2 edited

Legend:

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

    rc7e6a3e r52be5fa  
    8787}
    8888
     89/*
     90 * TODO: think about thread safety, if hr_metadata_save() can
     91 * be called from multiple threads, and if, maybe will need
     92 * md_lock... or whatever, but dont want to stall I/Os...
     93 */
    8994errno_t hr_metadata_save(hr_volume_t *vol)
    9095{
  • uspace/srv/bd/hr/util.c

    rc7e6a3e r52be5fa  
    823823        }
    824824
     825        /*
     826         * TODO: something like mark md dirty or whatever, just sync the
     827         * vol->counter with vol->in_mem_md->counter, or merge them and only
     828         * keep the vol->in_mem_md->counter...
     829         *
     830         * XXX: if thats the only thing that can change in metadata
     831         * during volume runtime, then whatever, but if more
     832         * things will need to be synced, think of something more clever
     833         *
     834         * TODO: remove from here and increment it the "first" time (if nothing
     835         * happens - no state changes, no rebuild, etc) - only after the first
     836         * write... but for now leave it here
     837         */
     838        vol->counter++;
     839        vol->in_mem_md->counter = vol->counter;
     840
     841        hr_metadata_save(vol);
     842
    825843        rc = vol->hr_ops.create(vol);
    826844        if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.