Changeset a3486f2 in mainline for uspace/srv/bd/hr/util.c
- Timestamp:
- 2025-06-17T14:17:20Z (6 days ago)
- Children:
- 137f7cf5
- Parents:
- 9d1685b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/util.c
r9d1685b ra3486f2 150 150 } 151 151 152 vol->fge = hr_fpool_create(16, 32, sizeof(hr_io_t)); 152 if (level == HR_LVL_4 || level == HR_LVL_5) 153 vol->fge = hr_fpool_create(16, 32, sizeof(hr_io_raid5_t)); 154 else 155 vol->fge = hr_fpool_create(16, 32, sizeof(hr_io_t)); 156 153 157 if (vol->fge == NULL) { 154 158 rc = ENOMEM; … … 164 168 165 169 vol->state = HR_VOL_NONE; 166 167 fibril_mutex_initialize(&vol->lock); /* XXX: will remove this */168 170 169 171 fibril_mutex_initialize(&vol->md_lock); … … 496 498 "(%" PRIun ")\n", vol->devname, hs_idx, old, new); 497 499 vol->hotspares[hs_idx].svc_id = new; 498 }499 500 /*501 * Do a whole sync (ba = 0, cnt = 0) across all extents,502 * and update extent state. *For now*, the caller has to503 * update volume state after the syncs.504 *505 * TODO: add update_vol_state fcn ptr for each raid506 */507 void hr_sync_all_extents(hr_volume_t *vol)508 {509 errno_t rc;510 511 fibril_mutex_lock(&vol->lock);512 for (size_t i = 0; i < vol->extent_no; i++) {513 if (vol->extents[i].state != HR_EXT_ONLINE)514 continue;515 rc = block_sync_cache(vol->extents[i].svc_id, 0, 0);516 if (rc == ENOMEM || rc == ENOTSUP)517 continue;518 if (rc != EOK) {519 if (rc == ENOENT)520 hr_update_ext_state(vol, i, HR_EXT_MISSING);521 else if (rc != EOK)522 hr_update_ext_state(vol, i, HR_EXT_FAILED);523 }524 }525 fibril_mutex_unlock(&vol->lock);526 500 } 527 501 … … 1116 1090 } 1117 1091 1092 void hr_raid5_xor(void *dst, const void *src, size_t size) 1093 { 1094 size_t i; 1095 uint64_t *d = dst; 1096 const uint64_t *s = src; 1097 1098 for (i = 0; i < size / sizeof(uint64_t); ++i) 1099 *d++ ^= *s++; 1100 } 1101 1118 1102 /** @} 1119 1103 */
Note:
See TracChangeset
for help on using the changeset viewer.