Changeset 6b8e89b0 in mainline for uspace/srv/bd/hr/raid0.c


Ignore:
Timestamp:
2024-10-05T13:11:11Z (8 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
dceb6e7
Parents:
dbd91da
git-author:
Miroslav Cimerman <mc@…> (2024-10-05 12:39:13)
git-committer:
Miroslav Cimerman <mc@…> (2024-10-05 13:11:11)
Message:

hr: init fuction for each RAID level

Compute total blocks, data blocks and set block size, data offset, strip
size there.

File:
1 edited

Legend:

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

    rdbd91da r6b8e89b0  
    4848#include <str_error.h>
    4949
     50#include "superblock.h"
    5051#include "util.h"
    5152#include "var.h"
     
    233234}
    234235
     236errno_t hr_raid0_init(hr_volume_t *vol)
     237{
     238        errno_t rc;
     239        size_t bsize;
     240        uint64_t total_blkno;
     241
     242        assert(vol->level == hr_l_0);
     243
     244        rc = hr_check_devs(vol, &total_blkno, &bsize);
     245        if (rc != EOK)
     246                return rc;
     247
     248        vol->nblocks = total_blkno;
     249        vol->bsize = bsize;
     250        vol->data_offset = HR_DATA_OFF;
     251        vol->data_blkno = vol->nblocks - (vol->data_offset * vol->dev_no);
     252        vol->strip_size = HR_STRIP_SIZE;
     253
     254        return EOK;
     255}
     256
    235257/** @}
    236258 */
Note: See TracChangeset for help on using the changeset viewer.