Changeset 4a2a6b8b in mainline for uspace/srv/bd/hr/util.c


Ignore:
Timestamp:
2024-09-06T22:09:33Z (11 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
57c61b0
Parents:
a19d7fc4
Message:

hr: add initial RAID 4 0 (non-rotating parity on disk 0)

File:
1 edited

Legend:

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

    ra19d7fc4 r4a2a6b8b  
    159159        if (vol->level == hr_l_1) {
    160160                vol->nblocks = total_blocks / vol->dev_no;
    161         } else if (vol->level == hr_l_0) {
     161        } else if (vol->level == hr_l_0 || vol->level == hr_l_4) {
    162162                vol->nblocks = total_blocks;
    163163        } else {
     
    172172}
    173173
    174 errno_t hr_calc_ba(hr_volume_t *vol, size_t cnt, uint64_t *ba)
     174errno_t hr_check_ba_range(hr_volume_t *vol, size_t cnt, uint64_t ba)
    175175{
    176         if (*ba + cnt > vol->data_blkno)
     176        if (ba + cnt > vol->data_blkno)
    177177                return ERANGE;
     178        return EOK;
     179}
    178180
     181void hr_add_ba_offset(hr_volume_t *vol, uint64_t *ba)
     182{
    179183        *ba = *ba + vol->data_offset;
    180         return EOK;
    181184}
    182185
Note: See TracChangeset for help on using the changeset viewer.