Changeset 4066371 in mainline
- Timestamp:
- 2024-12-06T20:19:21Z (7 months ago)
- Children:
- ea0d494
- Parents:
- 241c3f6
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/device/include/hr.h
r241c3f6 r4066371 55 55 } hr_level_t; 56 56 57 /* 58 * SNIA 59 * Common RAID Disk Data Format 60 * Specification 61 * Version 2.0 Revision 19 62 */ 63 #define HR_RLQ_RAID4_0 0x00 /* RAID-4 Non-Rotating Parity 0 */ 64 #define HR_RLQ_RAID4_N 0x01 /* RAID-4 Non-Rotating Parity N */ 65 #define HR_RLQ_RAID5_0R 0x00 /* RAID-5 Rotating Parity 0 with Data Restart */ 66 #define HR_RLQ_RAID5_NR 0x02 /* RAID-5 Rotating Parity N with Data Restart */ 67 #define HR_RLQ_RAID5_NC 0x03 /* RAID-5 Rotating Parity N with Data Continuation */ 68 57 69 typedef enum hr_vol_status { 58 70 HR_VOL_ONLINE, /* OK, OPTIMAL */ … … 97 109 size_t bsize; 98 110 hr_vol_status_t status; 111 uint8_t RLQ; 99 112 } hr_vol_info_t; 100 113 … … 109 122 extern const char *hr_get_vol_status_msg(hr_vol_status_t); 110 123 extern const char *hr_get_ext_status_msg(hr_ext_status_t); 124 extern const char *hr_get_layout_str(hr_level_t, uint8_t); 111 125 112 126 #endif -
uspace/lib/device/src/hr.c
r241c3f6 r4066371 133 133 134 134 printf("level: %d\n", vol_info->level); 135 if (vol_info->level == HR_LVL_4 || vol_info->level == HR_LVL_5) { 136 printf("layout: %s\n", 137 hr_get_layout_str(vol_info->level, vol_info->RLQ)); 138 } 135 139 if (vol_info->level == HR_LVL_0 || vol_info->level == HR_LVL_4) { 136 140 if (vol_info->strip_size / 1024 < 1) … … 159 163 return rc; 160 164 } 161 if (i == 0 && vol_info->level == HR_LVL_4) 162 printf(" P %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 163 else if (vol_info->level == HR_LVL_4) 164 printf(" %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 165 else 165 if (vol_info->level == HR_LVL_4) { 166 if ((i == 0 && vol_info->RLQ == HR_RLQ_RAID4_0) || 167 (i == vol_info->extent_no - 1 && 168 vol_info->RLQ == HR_RLQ_RAID4_N)) 169 printf(" P %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 170 else 171 printf(" %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 172 } else { 166 173 printf(" %s %zu %s\n", hr_get_ext_status_msg(ext->status), i, devname); 174 } 167 175 } 168 176 … … 343 351 } 344 352 353 const char *hr_get_layout_str(hr_level_t level, uint8_t RLQ) 354 { 355 switch (level) { 356 case HR_LVL_4: 357 switch (RLQ) { 358 case HR_RLQ_RAID4_0: 359 return "RAID-4 Non-Rotating Parity 0"; 360 case HR_RLQ_RAID4_N: 361 return "RAID-4 Non-Rotating Parity N"; 362 default: 363 return "RAID-4 INVALID"; 364 } 365 case HR_LVL_5: 366 switch (RLQ) { 367 case HR_RLQ_RAID5_0R: 368 return "RAID-5 Rotating Parity 0 with Data Restart"; 369 case HR_RLQ_RAID5_NR: 370 return "RAID-5 Rotating Parity N with Data Restart"; 371 case HR_RLQ_RAID5_NC: 372 return "RAID-5 Rotating Parity N with Data Continuation"; 373 default: 374 return "RAID-5 INVALID"; 375 } 376 default: 377 return "INVALID"; 378 } 379 } 380 345 381 /** @} 346 382 */ -
uspace/srv/bd/hr/hr.c
r241c3f6 r4066371 366 366 info.bsize = vol->bsize; 367 367 info.status = vol->status; 368 info.RLQ = vol->RLQ; 368 369 369 370 if (!async_data_read_receive(&call, &size)) { -
uspace/srv/bd/hr/var.h
r241c3f6 r4066371 80 80 hr_vol_status_t status; 81 81 hr_level_t level; 82 /*83 * SNIA84 * Common RAID Disk Data Format85 * Specification86 * Version 2.0 Revision 1987 */88 #define HR_RLQ_RAID4_0 0x00 /* RAID-4 Non-Rotating Parity 0 */89 #define HR_RLQ_RAID4_N 0x01 /* RAID-4 Non-Rotating Parity N */90 #define HR_RLQ_RAID5_0R 0x00 /* RAID-5 Rotating Parity 0 with Data Restart */91 #define HR_RLQ_RAID5_NR 0x02 /* RAID-5 Rotating Parity N with Data Restart */92 #define HR_RLQ_RAID5_NC 0x03 /* RAID-5 Rotating Parity N with Data Continuation */93 82 uint8_t RLQ; /* RAID Level Qualifier */ 94 83 char devname[HR_DEVNAME_LEN];
Note:
See TracChangeset
for help on using the changeset viewer.