diff options
Diffstat (limited to 'sys/cddl')
4 files changed, 19 insertions, 16 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c index 621aec0..ba65109 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c @@ -118,7 +118,7 @@ kstat_install(kstat_t *ksp) SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name, CTLTYPE_U64 | CTLFLAG_RD, ksent, sizeof(*ksent), - kstat_sysctl, "QU", ""); + kstat_sysctl, "QU", ksent->desc); } } diff --git a/sys/cddl/compat/opensolaris/sys/kstat.h b/sys/cddl/compat/opensolaris/sys/kstat.h index d73bd22..acf6626 100644 --- a/sys/cddl/compat/opensolaris/sys/kstat.h +++ b/sys/cddl/compat/opensolaris/sys/kstat.h @@ -53,6 +53,8 @@ typedef struct kstat_named { #define KSTAT_DATA_INT64 3 #define KSTAT_DATA_UINT64 4 uchar_t data_type; +#define KSTAT_DESCLEN 128 + char desc[KSTAT_DESCLEN]; union { uint64_t ui64; } value; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h index 47a0bba..b6dc9f5 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h @@ -372,23 +372,23 @@ typedef struct zio_trim_stats { /* * Number of bytes successfully TRIMmed. */ - kstat_named_t zio_trim_bytes; + kstat_named_t bytes; /* * Number of successful TRIM requests. */ - kstat_named_t zio_trim_success; + kstat_named_t success; /* * Number of TRIM requests that failed because TRIM is not * supported. */ - kstat_named_t zio_trim_unsupported; + kstat_named_t unsupported; /* * Number of TRIM requests that failed for other reasons. */ - kstat_named_t zio_trim_failed; + kstat_named_t failed; } zio_trim_stats_t; extern zio_trim_stats_t zio_trim_stats; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c index c2720dc..a5b1e93 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c @@ -48,14 +48,15 @@ TUNABLE_INT("vfs.zfs.zio.exclude_metadata", &zio_exclude_metadata); SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, exclude_metadata, CTLFLAG_RDTUN, &zio_exclude_metadata, 0, "Exclude metadata buffers from dumps as well"); -/* - * See zio.h for more information about these fields. - */ zio_trim_stats_t zio_trim_stats = { - { "zio_trim_bytes", KSTAT_DATA_UINT64 }, - { "zio_trim_success", KSTAT_DATA_UINT64 }, - { "zio_trim_unsupported", KSTAT_DATA_UINT64 }, - { "zio_trim_failed", KSTAT_DATA_UINT64 }, + { "bytes", KSTAT_DATA_UINT64, + "Number of bytes successfully TRIMmed" }, + { "success", KSTAT_DATA_UINT64, + "Number of successful TRIM requests" }, + { "unsupported", KSTAT_DATA_UINT64, + "Number of TRIM requests that failed because TRIM is not supported" }, + { "failed", KSTAT_DATA_UINT64, + "Number of TRIM requests that failed for reasons other than not supported" }, }; static kstat_t *zio_trim_ksp; @@ -2660,14 +2661,14 @@ zio_vdev_io_assess(zio_t *zio) if (zio->io_type == ZIO_TYPE_IOCTL && zio->io_cmd == DKIOCTRIM) switch (zio->io_error) { case 0: - ZIO_TRIM_STAT_INCR(zio_trim_bytes, zio->io_size); - ZIO_TRIM_STAT_BUMP(zio_trim_success); + ZIO_TRIM_STAT_INCR(bytes, zio->io_size); + ZIO_TRIM_STAT_BUMP(success); break; case EOPNOTSUPP: - ZIO_TRIM_STAT_BUMP(zio_trim_unsupported); + ZIO_TRIM_STAT_BUMP(unsupported); break; default: - ZIO_TRIM_STAT_BUMP(zio_trim_failed); + ZIO_TRIM_STAT_BUMP(failed); break; } |