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


Ignore:
Timestamp:
2024-10-05T13:11:11Z (10 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/raid4.c

    rdbd91da r6b8e89b0  
    4848#include <str_error.h>
    4949
     50#include "superblock.h"
    5051#include "util.h"
    5152#include "var.h"
     
    281282}
    282283
     284errno_t hr_raid4_init(hr_volume_t *vol)
     285{
     286        errno_t rc;
     287        size_t bsize;
     288        uint64_t total_blkno;
     289
     290        assert(vol->level == hr_l_4);
     291
     292        rc = hr_check_devs(vol, &total_blkno, &bsize);
     293        if (rc != EOK)
     294                return rc;
     295
     296        vol->nblocks = total_blkno;
     297        vol->bsize = bsize;
     298        vol->data_offset = HR_DATA_OFF;
     299        vol->data_blkno = vol->nblocks - (vol->data_offset * vol->dev_no) -
     300            (vol->nblocks / vol->dev_no);
     301        vol->strip_size = HR_STRIP_SIZE;
     302
     303        return EOK;
     304}
     305
    283306/** @}
    284307 */
Note: See TracChangeset for help on using the changeset viewer.