Changeset 7fba146 in mainline for uspace/srv/bd/hr/metadata/native.c


Ignore:
Timestamp:
2025-06-09T23:41:50Z (4 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
6791fbf
Parents:
83ff12f
Message:

hr: RAID 1: inc meta counter on first write

File:
1 edited

Legend:

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

    r83ff12f r7fba146  
    6363static bool meta_native_has_valid_magic(const void *);
    6464static bool meta_native_compare_uuids(const void *, const void *);
    65 static void meta_native_inc_counter(void *);
     65static void meta_native_inc_counter(hr_volume_t *);
    6666static errno_t meta_native_save(hr_volume_t *, bool);
    6767static const char *meta_native_get_devname(const void *);
     
    365365}
    366366
    367 static void meta_native_inc_counter(void *md_v)
    368 {
    369         hr_metadata_t *md = md_v;
     367static void meta_native_inc_counter(hr_volume_t *vol)
     368{
     369        fibril_mutex_lock(&vol->md_lock);
     370
     371        hr_metadata_t *md = vol->in_mem_md;
    370372
    371373        md->counter++;
     374
     375        fibril_mutex_unlock(&vol->md_lock);
    372376}
    373377
     
    409413                meta_native_encode(md, md_block);
    410414                rc = meta_native_write_block(ext->svc_id, md_block);
    411                 if (with_state_callback && rc != EOK)
     415                if (rc != EOK && with_state_callback)
    412416                        vol->hr_ops.ext_state_cb(vol, i, rc);
    413417        }
Note: See TracChangeset for help on using the changeset viewer.