Changeset 65706f1 in mainline for uspace/srv/bd/hr/raid0.c
- Timestamp:
- 2024-11-27T14:06:41Z (8 months ago)
- Children:
- a0c3080
- Parents:
- 40bf2c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/raid0.c
r40bf2c6 r65706f1 86 86 assert(new_volume->level == HR_LVL_0); 87 87 88 if (new_volume-> dev_no < 2) {88 if (new_volume->extent_no < 2) { 89 89 HR_ERROR("RAID 0 array needs at least 2 devices\n"); 90 90 return EINVAL; … … 119 119 vol->bsize = bsize; 120 120 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); 122 122 vol->strip_size = HR_STRIP_SIZE; 123 123 … … 190 190 static errno_t hr_raid0_update_vol_status(hr_volume_t *vol) 191 191 { 192 for (size_t i = 0; i < vol-> dev_no; i++) {192 for (size_t i = 0; i < vol->extent_no; i++) { 193 193 if (vol->extents[i].status != HR_EXT_ONLINE) { 194 194 HR_WARN("RAID 0 needs all extents to be ONLINE, " … … 231 231 uint64_t strip_size = vol->strip_size / vol->bsize; /* in blocks */ 232 232 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 */ 235 235 uint64_t strip_off = ba % strip_size; /* strip offset */ 236 236 … … 284 284 strip_off = 0; 285 285 extent++; 286 if (extent >= vol-> dev_no) {286 if (extent >= vol->extent_no) { 287 287 ext_stripe++; 288 288 extent = 0;
Note:
See TracChangeset
for help on using the changeset viewer.