summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-09 11:26:48 -0200
committerRenato Botelho <renato@netgate.com>2017-02-09 11:26:48 -0200
commit4a05f5440acda223e6a0ec5157bc32ecc0f09ff9 (patch)
tree4c2ece480e5d4155ed35bec62996de40eb179f18 /sys/geom/geom_disk.c
parent681a482d8fc4bfc14a24f7a9d75cca6337f2a520 (diff)
parenta1e52233c91fd46e666297270ab655f1abff8535 (diff)
downloadFreeBSD-src-4a05f5440acda223e6a0ec5157bc32ecc0f09ff9.zip
FreeBSD-src-4a05f5440acda223e6a0ec5157bc32ecc0f09ff9.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index a0a357f..18402c4 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -589,12 +589,12 @@ g_disk_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g
* special cases, and there's also a valid range.
*/
sbuf_printf(sb, "%s<rotationrate>", indent);
- if (dp->d_rotation_rate == 0) /* Old drives don't */
- sbuf_printf(sb, "unknown"); /* report RPM. */
- else if (dp->d_rotation_rate == 1) /* Since 0 is used */
- sbuf_printf(sb, "0"); /* above, SSDs use 1. */
- else if ((dp->d_rotation_rate >= 0x041) &&
- (dp->d_rotation_rate <= 0xfffe))
+ if (dp->d_rotation_rate == DISK_RR_UNKNOWN) /* Old drives */
+ sbuf_printf(sb, "unknown"); /* don't report RPM. */
+ else if (dp->d_rotation_rate == DISK_RR_NON_ROTATING)
+ sbuf_printf(sb, "0");
+ else if ((dp->d_rotation_rate >= DISK_RR_MIN) &&
+ (dp->d_rotation_rate <= DISK_RR_MAX))
sbuf_printf(sb, "%u", dp->d_rotation_rate);
else
sbuf_printf(sb, "invalid");
OpenPOWER on IntegriCloud