This adds struct disk's rotation_rate to the output of geom disk list, which is useful to collect into inventory databases or make decisions on with configuration management software.
Details
Details
root@cds124.lab:~# geom disk list
Geom name: da0
Providers:
- Name: da0 Mediasize: 480103981056 (447G) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r4w4e11 descr: ATA SAMSUNG MZ7WD480 lunid: 5002538500234d15 ident: S1G1NYAF930242 rotationrate: 1 fwsectors: 63 fwheads: 255
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2129 Build 2137: arc lint + arc unit
Event Timeline
Comment Actions
I was actually going to take a look at this one this weekend. My concern is that SSDs report a rotationrate of 1, not 0:
Value | Description |
0000h | Rate not reported |
0001h | Non-rotating media (e.g., solid state device) |
0002h-0400h | Reserved |
0401h-FFFEh | Nominal media rotation rate in rotations per minute (rpm) (e.g., 7200 rpm = 1C20h) |
FFFFh | Reserved |
(That wording is copied from the ATA specs, but SCSI uses the same values for the meaning.)
I was going to validate the d_rotation_rate value before using it. i.e.:
sbuf_printf(sb, "%s<rotationrate>", indent); if (dp->d_rotatation_rate == 0) sbuf_printf(sb, "unknown"); else if (dp->d_rotation_rate == 1) sbuf_printf(sb, "0"); else if ((dp->d_rotation_rate >= 0x041) && (dp->d_rotation_rate <= 0xfffe)) sbuf_printf(sb, "%u", dp->d_rotation_rate); else sbuf_printf(sb, "invalid"); sbuf_printf(sb, "</rotationrate>\n");
Comment Actions
Your logic makes sense to me. Ravi, can you integrate this and MFC to 10-STABLE during slush?
Comment Actions
I'm going to steal this from @kevin.bowling_kev009.com because I have a newer patch, and I can eventually commit it.