Changeset 996d31ac in mainline for uspace/srv/bd/hr/hr.c


Ignore:
Timestamp:
2025-07-02T20:43:58Z (9 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
038a8d0
Parents:
dcdb990
Message:

hr: retire level specific add_hotspare() hr_ops_t

File:
1 edited

Legend:

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

    rdcdb990 r996d31ac  
    407407        }
    408408
    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",
    412418                    hr_get_metadata_type_str(vol->meta_ops->get_type()));
    413419                async_answer_0(icall, ENOTSUP);
     
    415421        }
    416422
    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);
    418426
    419427        async_answer_0(icall, rc);
Note: See TracChangeset for help on using the changeset viewer.