diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index 9d3008934fa2..8d3266b3aa80 100644 --- a/include/sys/fs/zfs.h +++ b/include/sys/fs/zfs.h @@ -723,6 +723,12 @@ typedef enum vdev_aux { VDEV_AUX_SPLIT_POOL /* vdev was split off into another pool */ } vdev_aux_t; +typedef enum vdev_nonrotational_info { + VDEV_NONROTATIONAL_YES, /* device is solid state */ + VDEV_NONROTATIONAL_MIXED, /* device has both kinds */ + VDEV_NONROTATIONAL_NO /* device is not solid state */ +} vdev_nonrotational_info_t; + /* * pool state. The following states are written to disk as part of the normal * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining @@ -812,6 +818,7 @@ typedef struct vdev_stat { hrtime_t vs_timestamp; /* time since vdev load */ uint64_t vs_state; /* vdev state */ uint64_t vs_aux; /* see vdev_aux_t */ + uint64_t vs_nonrotational; /* nonrotational */ uint64_t vs_alloc; /* space allocated */ uint64_t vs_space; /* total capacity */ uint64_t vs_dspace; /* deflated capacity */ diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 8bfd8df239b6..1a9f680de8fc 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -2898,6 +2898,16 @@ vdev_get_stats_ex(vdev_t *vd, vdev_stat_t *vs, vdev_stat_ex_t *vsx) !vd->vdev_ishole) { vs->vs_fragmentation = vd->vdev_mg->mg_fragmentation; } + /* + * This is static information, so could be set in vd->vdev_stat + * elsewhere...? + */ + if (vd->vdev_nonrot_mix) + vs->vs_nonrotational = VDEV_NONROTATIONAL_MIXED; + else if (vd->vdev_nonrot) + vs->vs_nonrotational = VDEV_NONROTATIONAL_YES; + else + vs->vs_nonrotational = VDEV_NONROTATIONAL_NO; } ASSERT(spa_config_held(vd->vdev_spa, SCL_ALL, RW_READER) != 0);