Changeset d1d355f in mainline for uspace/lib/device/src/hr.c
- Timestamp:
- 2025-05-06T21:30:30Z (5 weeks ago)
- Children:
- c2f0160
- Parents:
- 40f56a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/device/src/hr.c
r40f56a4 rd1d355f 109 109 async_exchange_end(exch); 110 110 async_wait_for(req, &retval); 111 if (retval != EOK) 112 return retval; 113 114 return EOK; 111 return retval; 115 112 } 116 113 … … 269 266 } 270 267 271 errno_t hr_stop(const char *devname , long extent)268 errno_t hr_stop(const char *devname) 272 269 { 273 270 hr_t *hr; … … 289 286 goto error; 290 287 } 291 rc = async_req_2_0(exch, HR_STOP, svc_id, extent); 288 289 rc = async_req_1_0(exch, HR_STOP, svc_id); 292 290 async_exchange_end(exch); 293 291 error: … … 296 294 } 297 295 298 errno_t hr_ add_hotspare(service_id_t vol_svc_id, service_id_t hs_svc_id)296 errno_t hr_stop_all(void) 299 297 { 300 298 hr_t *hr; 301 errno_t rc; 302 async_exch_t *exch; 299 async_exch_t *exch; 300 errno_t rc; 301 302 rc = hr_sess_init(&hr); 303 if (rc != EOK) 304 return rc; 305 306 exch = async_exchange_begin(hr->sess); 307 if (exch == NULL) { 308 rc = EINVAL; 309 goto error; 310 } 311 312 rc = async_req_0_0(exch, HR_STOP_ALL); 313 async_exchange_end(exch); 314 error: 315 hr_sess_destroy(hr); 316 return rc; 317 } 318 319 errno_t hr_fail_extent(const char *volume_name, unsigned long extent) 320 { 321 hr_t *hr; 322 errno_t rc; 323 async_exch_t *exch; 324 service_id_t vol_svc_id; 325 326 rc = loc_service_get_id(volume_name, &vol_svc_id, 0); 327 if (rc != EOK) 328 return rc; 329 330 rc = hr_sess_init(&hr); 331 if (rc != EOK) 332 return rc; 333 334 exch = async_exchange_begin(hr->sess); 335 if (exch == NULL) { 336 rc = EINVAL; 337 goto error; 338 } 339 340 rc = async_req_2_0(exch, HR_FAIL_EXTENT, vol_svc_id, extent); 341 async_exchange_end(exch); 342 error: 343 hr_sess_destroy(hr); 344 return rc; 345 } 346 347 errno_t hr_add_hotspare(const char *volume_name, const char *hotspare) 348 { 349 hr_t *hr; 350 errno_t rc; 351 async_exch_t *exch; 352 service_id_t vol_svc_id, hs_svc_id; 353 354 rc = loc_service_get_id(volume_name, &vol_svc_id, 0); 355 if (rc != EOK) 356 return rc; 357 358 rc = loc_service_get_id(hotspare, &hs_svc_id, 0); 359 if (rc != EOK) 360 return rc; 303 361 304 362 rc = hr_sess_init(&hr);
Note:
See TracChangeset
for help on using the changeset viewer.