FreeBSD: Fix up after spa_stats.c move

Moving spa_stats added the additional burden of supporting
KSTAT_TYPE_IO.

spa_state_addr will always return a valid value regardless of
the value of 'n'. On FreeBSD this will cause an infinite loop
as it relies on the raw ops addr routine to indicate that there
is no more data.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10860
This commit is contained in:
Matthew Macy
2020-09-01 16:16:56 -07:00
committed by GitHub
parent 7b4e27232d
commit e84e49218f
2 changed files with 116 additions and 61 deletions
+3 -1
View File
@@ -835,7 +835,9 @@ spa_mmp_history_add(spa_t *spa, uint64_t txg, uint64_t timestamp,
static void *
spa_state_addr(kstat_t *ksp, loff_t n)
{
return (ksp->ks_private); /* return the spa_t */
if (n == 0)
return (ksp->ks_private); /* return the spa_t */
return (NULL);
}
static int