Changeset d7768d11 in mainline for uspace/srv/bd/hr/superblock.c


Ignore:
Timestamp:
2024-12-06T19:46:43Z (10 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
241c3f6
Parents:
586b39d
Message:

hr: add different RAID4,5 layouts

Also prepare the metadata for metada versioning
and sync counter.

File:
1 edited

Legend:

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

    r586b39d rd7768d11  
    153153
    154154        metadata->magic = host2uint64_t_le(HR_MAGIC);
     155        metadata->version = host2uint32_t_le(~(0U)); /* unused */
    155156        metadata->extent_no = host2uint32_t_le(vol->extent_no);
     157        /* index filled separately for each extent */
    156158        metadata->level = host2uint32_t_le(vol->level);
     159        metadata->layout = host2uint32_t_le(vol->RLQ);
     160        metadata->strip_size = host2uint32_t_le(vol->strip_size);
    157161        metadata->nblocks = host2uint64_t_le(vol->nblocks);
    158162        metadata->data_blkno = host2uint64_t_le(vol->data_blkno);
    159         metadata->data_offset = host2uint32_t_le(vol->data_offset);
    160         metadata->strip_size = host2uint32_t_le(vol->strip_size);
    161 
     163        metadata->data_offset = host2uint64_t_le(vol->data_offset);
     164        metadata->counter = host2uint64_t_le(~(0UL)); /* unused */
     165        /* UUID generated separately for each extent */
    162166        str_cpy(metadata->devname, HR_DEVNAME_LEN, vol->devname);
    163167
     
    231235        }
    232236
     237        /* TODO: handle version */
    233238        vol->level = uint32_t_le2host(metadata->level);
     239        vol->RLQ = (uint8_t)uint32_t_le2host(metadata->layout);
     240        vol->strip_size = uint32_t_le2host(metadata->strip_size);
    234241        vol->nblocks = uint64_t_le2host(metadata->nblocks);
    235242        vol->data_blkno = uint64_t_le2host(metadata->data_blkno);
    236         vol->data_offset = uint32_t_le2host(metadata->data_offset);
    237         vol->strip_size = uint32_t_le2host(metadata->strip_size);
     243        vol->data_offset = uint64_t_le2host(metadata->data_offset);
     244        vol->counter = uint64_t_le2host(0x00); /* unused */
    238245
    239246        if (str_cmp(metadata->devname, vol->devname) != 0) {
Note: See TracChangeset for help on using the changeset viewer.