Changeset 7b359f5 in mainline


Ignore:
Timestamp:
2024-11-15T21:45:31Z (6 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
e76e12d8
Parents:
d199a6f
Message:

hr: status/state event function for each RAID

Location:
uspace/srv/bd/hr
Files:
6 edited

Legend:

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

    rd199a6f r7b359f5  
    190190                new_volume->hr_ops.create = hr_raid1_create;
    191191                new_volume->hr_ops.init = hr_raid1_init;
     192                new_volume->hr_ops.status_event = hr_raid1_status_event;
    192193                break;
    193194        case HR_LVL_0:
    194195                new_volume->hr_ops.create = hr_raid0_create;
    195196                new_volume->hr_ops.init = hr_raid0_init;
     197                new_volume->hr_ops.status_event = hr_raid0_status_event;
    196198                break;
    197199        case HR_LVL_4:
    198200                new_volume->hr_ops.create = hr_raid4_create;
    199201                new_volume->hr_ops.init = hr_raid4_init;
     202                new_volume->hr_ops.status_event = hr_raid4_status_event;
    200203                break;
    201204        case HR_LVL_5:
    202205                new_volume->hr_ops.create = hr_raid5_create;
    203206                new_volume->hr_ops.init = hr_raid5_init;
     207                new_volume->hr_ops.status_event = hr_raid5_status_event;
    204208                break;
    205209        default:
     
    277281                hr_update_ext_status(vol, fail_extent, HR_EXT_FAILED);
    278282                fibril_mutex_unlock(&vol->lock);
     283
     284                vol->hr_ops.status_event(vol);
    279285        }
    280286        async_answer_0(icall, rc);
  • uspace/srv/bd/hr/raid0.c

    rd199a6f r7b359f5  
    125125}
    126126
     127void hr_raid0_status_event(hr_volume_t *vol)
     128{
     129        fibril_mutex_lock(&vol->lock);
     130        (void) hr_raid0_update_vol_status(vol);
     131        fibril_mutex_unlock(&vol->lock);
     132}
     133
    127134static errno_t hr_raid0_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
    128135{
  • uspace/srv/bd/hr/raid1.c

    rd199a6f r7b359f5  
    125125}
    126126
     127void hr_raid1_status_event(hr_volume_t *vol)
     128{
     129        fibril_mutex_lock(&vol->lock);
     130        (void) hr_raid1_update_vol_status(vol);
     131        fibril_mutex_unlock(&vol->lock);
     132}
     133
    127134static errno_t hr_raid1_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
    128135{
  • uspace/srv/bd/hr/raid4.c

    rd199a6f r7b359f5  
    136136
    137137        return EOK;
     138}
     139
     140void hr_raid4_status_event(hr_volume_t *vol)
     141{
     142        fibril_mutex_lock(&vol->lock);
     143        (void) hr_raid4_update_vol_status(vol);
     144        fibril_mutex_unlock(&vol->lock);
    138145}
    139146
  • uspace/srv/bd/hr/raid5.c

    rd199a6f r7b359f5  
    133133
    134134        return EOK;
     135}
     136
     137void hr_raid5_status_event(hr_volume_t *vol)
     138{
     139        fibril_mutex_lock(&vol->lock);
     140        (void) hr_raid5_update_vol_status(vol);
     141        fibril_mutex_unlock(&vol->lock);
    135142}
    136143
  • uspace/srv/bd/hr/var.h

    rd199a6f r7b359f5  
    5050        errno_t (*create)(hr_volume_t *);
    5151        errno_t (*init)(hr_volume_t *);
     52        void    (*status_event)(hr_volume_t *);
    5253} hr_ops_t;
    5354
     
    8990extern errno_t hr_raid5_init(hr_volume_t *);
    9091
     92extern void hr_raid0_status_event(hr_volume_t *);
     93extern void hr_raid1_status_event(hr_volume_t *);
     94extern void hr_raid4_status_event(hr_volume_t *);
     95extern void hr_raid5_status_event(hr_volume_t *);
     96
    9197#endif
    9298
Note: See TracChangeset for help on using the changeset viewer.