Changeset e47a032 in mainline for uspace/lib/device/src/hr.c
- Timestamp:
- 2024-10-28T20:02:39Z (7 months ago)
- Children:
- 9fc1d36d
- Parents:
- 066fed9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/device/src/hr.c
r066fed9 re47a032 130 130 printf("devname: %s\n", devname); 131 131 132 printf("status: %s\n", hr_get_vol_status_msg(vol_info->status)); 133 132 134 printf("level: %d\n", vol_info->level); 133 135 if (vol_info->level == HR_LVL_0 || vol_info->level == HR_LVL_4) { … … 150 152 for (i = 0; i < vol_info->extent_no; i++) { 151 153 ext = &vol_info->extents[i]; 152 rc = loc_service_get_name(ext->svc_id, &devname); 153 if (rc != EOK) 154 return rc; 154 if (ext->status == HR_EXT_MISSING) { 155 devname = (char *) "MISSING-devname"; 156 } else { 157 rc = loc_service_get_name(ext->svc_id, &devname); 158 if (rc != EOK) 159 return rc; 160 } 155 161 if (i == 0 && vol_info->level == HR_LVL_4) 156 printf(" P % d %zu %s\n", ext->status, i, devname);162 printf(" P %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 157 163 else if (vol_info->level == HR_LVL_4) 158 printf(" % d %zu %s\n", ext->status, i, devname);164 printf(" %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 159 165 else 160 printf(" % d %zu %s\n", ext->status, i, devname);166 printf(" %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 161 167 } 162 168 return EOK; … … 262 268 } 263 269 270 const char *hr_get_vol_status_msg(hr_vol_status_t status) 271 { 272 switch (status) { 273 case HR_VOL_ONLINE: 274 return "ONLINE"; 275 case HR_VOL_FAULTY: 276 return "FAULTY"; 277 default: 278 return "UNKNOWN"; 279 } 280 } 281 282 const char *hr_get_ext_status_msg(hr_ext_status_t status) 283 { 284 switch (status) { 285 case HR_EXT_ONLINE: 286 return "ONLINE"; 287 case HR_EXT_MISSING: 288 return "MISSING"; 289 case HR_EXT_FAILED: 290 return "FAILED"; 291 default: 292 return "UNKNOWN"; 293 } 294 } 295 264 296 /** @} 265 297 */
Note:
See TracChangeset
for help on using the changeset viewer.