Changeset f81960c5 in mainline


Ignore:
Timestamp:
2024-11-22T21:23:38Z (7 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
30140c1b
Parents:
b56d88f
Message:

hr: RAID1: style

File:
1 edited

Legend:

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

    rb56d88f rf81960c5  
    5555static errno_t hr_raid1_check_vol_status(hr_volume_t *);
    5656static errno_t hr_raid1_update_vol_status(hr_volume_t *);
    57 static void handle_extent_error(hr_volume_t *, size_t, errno_t);
     57static void hr_raid1_handle_extent_error(hr_volume_t *, size_t, errno_t);
    5858static errno_t hr_raid1_bd_op(hr_bd_op_type_t, bd_srv_t *, aoff64_t, size_t,
    5959    void *, const void *, size_t);
     
    268268}
    269269
    270 static void handle_extent_error(hr_volume_t *vol, size_t extent,
     270static void hr_raid1_handle_extent_error(hr_volume_t *vol, size_t extent,
    271271    errno_t rc)
    272272{
     
    310310                        rc = block_sync_cache(vol->extents[i].svc_id, ba, cnt);
    311311                        if (rc != EOK && rc != ENOTSUP)
    312                                 handle_extent_error(vol, i, rc);
     312                                hr_raid1_handle_extent_error(vol, i, rc);
    313313                        else
    314314                                successful++;
     
    322322                            data_read);
    323323                        if (rc != EOK) {
    324                                 handle_extent_error(vol, i, rc);
     324                                hr_raid1_handle_extent_error(vol, i, rc);
    325325                        } else {
    326326                                successful++;
     
    345345                            data_write);
    346346                        if (rc != EOK)
    347                                 handle_extent_error(vol, i, rc);
     347                                hr_raid1_handle_extent_error(vol, i, rc);
    348348                        else
    349349                                successful++;
     
    434434
    435435        hr_extent_t *ext;
    436         size_t rebuild_ext_idx = bad;
    437436
    438437        size_t cnt;
     
    448447                                    buf);
    449448                                if (rc != EOK) {
    450                                         handle_extent_error(vol, i, rc);
     449                                        hr_raid1_handle_extent_error(vol, i, rc);
    451450                                        if (i + 1 < vol->dev_no) {
    452451                                                /* still might have one ONLINE */
     
    465464                rc = block_write_direct(hotspare->svc_id, ba, cnt, buf);
    466465                if (rc != EOK) {
    467                         handle_extent_error(vol, rebuild_ext_idx, rc);
    468                         HR_ERROR("rebuild on \"%s\" (%lu), extent number %lu\n",
    469                             vol->devname, vol->svc_id, rebuild_ext_idx);
     466                        hr_raid1_handle_extent_error(vol, bad, rc);
     467                        HR_ERROR("rebuild on \"%s\" (%lu), failed due to "
     468                            "the rebuilt extent number %lu failing\n",
     469                            vol->devname, vol->svc_id, bad);
    470470                        goto end;
    471471
     
    479479            "extent number %lu\n", vol->devname, vol->svc_id, hotspare_idx);
    480480
    481         hr_update_ext_status(vol, hotspare_idx, HR_EXT_ONLINE);
     481        hr_update_ext_status(vol, bad, HR_EXT_ONLINE);
    482482        /*
    483483         * For now write metadata at the end, because
Note: See TracChangeset for help on using the changeset viewer.