Changeset 8b51009 in mainline for uspace/lib/device/src/hr.c
- Timestamp:
- 2025-03-28T23:37:16Z (4 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.