Changeset 996d31ac in mainline
- Timestamp:
- 2025-07-02T20:43:58Z (6 months ago)
- Children:
- 038a8d0
- Parents:
- dcdb990
- Location:
- uspace/srv/bd/hr
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/hr.c
rdcdb990 r996d31ac 407 407 } 408 408 409 if (vol->hr_ops.add_hotspare == NULL) { 410 HR_NOTE("hotspare not supported on RAID level = %d, " 411 "metadata type = %s\n", vol->level, 409 if (vol->level == HR_LVL_0) { 410 HR_NOTE("hotspare not supported on RAID level = %s\n", 411 hr_get_level_str(vol->level)); 412 async_answer_0(icall, ENOTSUP); 413 return; 414 } 415 416 if (!(vol->meta_ops->get_flags() & HR_METADATA_HOTSPARE_SUPPORT)) { 417 HR_NOTE("hotspare not supported on metadata type = %s\n", 412 418 hr_get_metadata_type_str(vol->meta_ops->get_type())); 413 419 async_answer_0(icall, ENOTSUP); … … 415 421 } 416 422 417 rc = vol->hr_ops.add_hotspare(vol, hotspare); 423 rc = hr_util_add_hotspare(vol, hotspare); 424 425 vol->hr_ops.vol_state_eval(vol); 418 426 419 427 async_answer_0(icall, rc); -
uspace/srv/bd/hr/raid1.c
rdcdb990 r996d31ac 133 133 } 134 134 135 errno_t hr_raid1_add_hotspare(hr_volume_t *vol, service_id_t hotspare)136 {137 HR_DEBUG("%s()", __func__);138 139 errno_t rc = hr_util_add_hotspare(vol, hotspare);140 141 hr_raid1_vol_state_eval(vol);142 143 return rc;144 }145 146 135 void hr_raid1_vol_state_eval(hr_volume_t *vol) 147 136 { -
uspace/srv/bd/hr/raid5.c
rdcdb990 r996d31ac 155 155 } 156 156 157 errno_t hr_raid5_add_hotspare(hr_volume_t *vol, service_id_t hotspare)158 {159 HR_DEBUG("%s()", __func__);160 161 errno_t rc = hr_util_add_hotspare(vol, hotspare);162 163 hr_raid5_vol_state_eval(vol);164 165 return rc;166 }167 168 157 void hr_raid5_ext_state_cb(hr_volume_t *vol, size_t extent, errno_t rc) 169 158 { -
uspace/srv/bd/hr/util.c
rdcdb990 r996d31ac 119 119 vol->meta_ops = hr_get_meta_type_ops(metadata_type); 120 120 121 uint8_t meta_flags = vol->meta_ops->get_flags();122 123 121 switch (level) { 124 122 case HR_LVL_0: … … 133 131 vol->hr_ops.vol_state_eval = hr_raid1_vol_state_eval; 134 132 vol->hr_ops.ext_state_cb = hr_raid1_ext_state_cb; 135 if (meta_flags & HR_METADATA_HOTSPARE_SUPPORT)136 vol->hr_ops.add_hotspare = hr_raid1_add_hotspare;137 133 break; 138 134 case HR_LVL_4: … … 142 138 vol->hr_ops.vol_state_eval = hr_raid5_vol_state_eval; 143 139 vol->hr_ops.ext_state_cb = hr_raid5_ext_state_cb; 144 if (meta_flags & HR_METADATA_HOTSPARE_SUPPORT)145 vol->hr_ops.add_hotspare = hr_raid5_add_hotspare;146 140 break; 147 141 default: -
uspace/srv/bd/hr/var.h
rdcdb990 r996d31ac 66 66 errno_t (*create)(hr_volume_t *); 67 67 errno_t (*init)(hr_volume_t *); 68 errno_t (*add_hotspare)(hr_volume_t *, service_id_t);69 68 void (*vol_state_eval)(hr_volume_t *); 70 69 void (*ext_state_cb)(hr_volume_t *, size_t, errno_t); … … 138 137 extern errno_t hr_raid5_init(hr_volume_t *); 139 138 140 extern errno_t hr_raid1_add_hotspare(hr_volume_t *, service_id_t);141 extern errno_t hr_raid5_add_hotspare(hr_volume_t *, service_id_t);142 143 139 extern void hr_raid0_vol_state_eval(hr_volume_t *); 144 140 extern void hr_raid1_vol_state_eval(hr_volume_t *);
Note:
See TracChangeset
for help on using the changeset viewer.
