Changeset c9ce6d22 in mainline for uspace/srv/bd/hr/hr.c
- Timestamp:
- 2025-05-15T19:24:51Z (3 weeks ago)
- Children:
- a2281efc
- Parents:
- 9a3eec1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/hr.c
r9a3eec1 rc9ce6d22 296 296 errno_t rc = EOK; 297 297 service_id_t svc_id; 298 hr_volume_t *vol;299 298 300 299 svc_id = ipc_get_arg1(icall); 301 300 302 vol = hr_get_volume(svc_id); 303 if (vol == NULL) { 304 async_answer_0(icall, ENOENT); 305 return; 306 } 307 308 rc = hr_remove_volume(vol); 301 rc = hr_remove_volume(svc_id); 309 302 310 303 async_answer_0(icall, rc); … … 319 312 HR_DEBUG("%s()", __func__); 320 313 321 hr_volume_t *vol;314 service_id_t *vol_svcs = NULL; 322 315 errno_t rc = EOK; 323 324 while (true) { 325 fibril_rwlock_write_lock(&hr_volumes_lock); 326 if (list_empty(&hr_volumes)) { 327 fibril_rwlock_write_unlock(&hr_volumes_lock); 328 break; 329 } 330 331 vol = list_pop(&hr_volumes, hr_volume_t, lvolumes); 332 333 fibril_rwlock_write_unlock(&hr_volumes_lock); 334 335 rc = hr_remove_volume(vol); 316 size_t i, vol_cnt; 317 318 rc = hr_get_volume_svcs(&vol_cnt, &vol_svcs); 319 if (rc != EOK) 320 goto fail; 321 322 for (i = 0; i < vol_cnt; i++) { 323 rc = hr_remove_volume(vol_svcs[i]); 336 324 if (rc != EOK) 337 325 break; 338 326 } 339 327 328 fail: 329 if (vol_svcs != NULL) 330 free(vol_svcs); 340 331 async_answer_0(icall, rc); 341 332 }
Note:
See TracChangeset
for help on using the changeset viewer.