Changeset 65706f1 in mainline for uspace/srv/bd/hr/raid0.c


Ignore:
Timestamp:
2024-11-27T14:06:41Z (8 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
a0c3080
Parents:
40bf2c6
Message:

hr: rename dev_no → extent_no in hr_volume_t

File:
1 edited

Legend:

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

    r40bf2c6 r65706f1  
    8686        assert(new_volume->level == HR_LVL_0);
    8787
    88         if (new_volume->dev_no < 2) {
     88        if (new_volume->extent_no < 2) {
    8989                HR_ERROR("RAID 0 array needs at least 2 devices\n");
    9090                return EINVAL;
     
    119119        vol->bsize = bsize;
    120120        vol->data_offset = HR_DATA_OFF;
    121         vol->data_blkno = vol->nblocks - (vol->data_offset * vol->dev_no);
     121        vol->data_blkno = vol->nblocks - (vol->data_offset * vol->extent_no);
    122122        vol->strip_size = HR_STRIP_SIZE;
    123123
     
    190190static errno_t hr_raid0_update_vol_status(hr_volume_t *vol)
    191191{
    192         for (size_t i = 0; i < vol->dev_no; i++) {
     192        for (size_t i = 0; i < vol->extent_no; i++) {
    193193                if (vol->extents[i].status != HR_EXT_ONLINE) {
    194194                        HR_WARN("RAID 0 needs all extents to be ONLINE, "
     
    231231        uint64_t strip_size = vol->strip_size / vol->bsize; /* in blocks */
    232232        uint64_t stripe = ba / strip_size; /* stripe number */
    233         uint64_t extent = stripe % vol->dev_no;
    234         uint64_t ext_stripe = stripe / vol->dev_no; /* stripe level */
     233        uint64_t extent = stripe % vol->extent_no;
     234        uint64_t ext_stripe = stripe / vol->extent_no; /* stripe level */
    235235        uint64_t strip_off = ba % strip_size; /* strip offset */
    236236
     
    284284                strip_off = 0;
    285285                extent++;
    286                 if (extent >= vol->dev_no) {
     286                if (extent >= vol->extent_no) {
    287287                        ext_stripe++;
    288288                        extent = 0;
Note: See TracChangeset for help on using the changeset viewer.