Changeset 9a3eec1 in mainline for uspace/srv/bd/hr/util.c
- Timestamp:
- 2025-05-15T19:23:42Z (4 weeks ago)
- Children:
- c9ce6d22
- Parents:
- 287b2ea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/util.c
r287b2ea r9a3eec1 173 173 } 174 174 175 errno_t hr_get_volume_svcs(size_t *rcnt, service_id_t **rsvcs) 176 { 177 size_t i; 178 service_id_t *vol_svcs; 179 180 if (rcnt == NULL || rsvcs == NULL) 181 return EINVAL; 182 183 fibril_rwlock_read_lock(&hr_volumes_lock); 184 185 size_t vol_cnt = list_count(&hr_volumes); 186 vol_svcs = malloc(vol_cnt * sizeof(service_id_t)); 187 if (vol_svcs == NULL) { 188 fibril_rwlock_read_unlock(&hr_volumes_lock); 189 return ENOMEM; 190 } 191 192 i = 0; 193 list_foreach(hr_volumes, lvolumes, hr_volume_t, iter) 194 vol_svcs[i++] = iter->svc_id; 195 196 fibril_rwlock_read_unlock(&hr_volumes_lock); 197 198 *rcnt = vol_cnt; 199 *rsvcs = vol_svcs; 200 201 return EOK; 202 } 203 175 204 hr_volume_t *hr_get_volume(service_id_t svc_id) 176 205 {
Note:
See TracChangeset
for help on using the changeset viewer.