Changeset 8b51009 in mainline for uspace/lib/device
- Timestamp:
- 2025-03-28T23:37:16Z (10 months ago)
- Children:
- 0437dd5
- Parents:
- 7bfe468
- git-author:
- Miroslav Cimerman <mc@…> (2025-03-28 23:25:57)
- git-committer:
- Miroslav Cimerman <mc@…> (2025-03-28 23:37:16)
- Location:
- uspace/lib/device
- Files:
-
- 3 edited
-
include/hr.h (modified) (1 diff)
-
include/ipc/hr.h (modified) (2 diffs)
-
src/hr.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/device/include/hr.h
r7bfe468 r8b51009 118 118 extern void hr_sess_destroy(hr_t *); 119 119 extern errno_t hr_create(hr_t *, hr_config_t *, bool); 120 extern errno_t hr_auto_assemble(size_t *); 120 121 extern errno_t hr_stop(const char *, long); 121 122 extern errno_t hr_add_hotspare(service_id_t, service_id_t); -
uspace/lib/device/include/ipc/hr.h
r7bfe468 r8b51009 1 1 /* 2 * Copyright (c) 202 4Miroslav Cimerman2 * Copyright (c) 2025 Miroslav Cimerman 3 3 * All rights reserved. 4 4 * … … 41 41 HR_CREATE = IPC_FIRST_USER_METHOD, 42 42 HR_ASSEMBLE, 43 HR_AUTO_ASSEMBLE, 43 44 HR_STOP, 44 45 HR_ADD_HOTSPARE, -
uspace/lib/device/src/hr.c
r7bfe468 r8b51009 115 115 } 116 116 117 errno_t hr_auto_assemble(size_t *rassembled_cnt) 118 { 119 hr_t *hr; 120 errno_t rc; 121 size_t assembled_cnt; 122 123 rc = hr_sess_init(&hr); 124 if (rc != EOK) 125 return rc; 126 127 async_exch_t *exch = async_exchange_begin(hr->sess); 128 if (exch == NULL) { 129 rc = EINVAL; 130 goto error; 131 } 132 133 aid_t req = async_send_0(exch, HR_AUTO_ASSEMBLE, NULL); 134 135 rc = async_data_read_start(exch, &assembled_cnt, sizeof(size_t)); 136 if (rc != EOK) { 137 async_exchange_end(exch); 138 async_forget(req); 139 return rc; 140 } 141 142 async_exchange_end(exch); 143 async_wait_for(req, &rc); 144 145 if (rassembled_cnt != NULL) 146 *rassembled_cnt = assembled_cnt; 147 error: 148 hr_sess_destroy(hr); 149 return rc; 150 } 151 117 152 static errno_t print_vol_info(size_t index, hr_vol_info_t *vol_info) 118 153 { … … 218 253 rc = async_req_2_0(exch, HR_STOP, svc_id, extent); 219 254 async_exchange_end(exch); 220 221 if (rc != EOK)222 goto error;223 255 error: 224 256 hr_sess_destroy(hr);
Note:
See TracChangeset
for help on using the changeset viewer.
