summaryrefslogtreecommitdiffstats
path: root/include/sys/spa.h
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2018-06-06 09:33:54 -0700
committerBrian Behlendorf <[email protected]>2018-06-06 09:33:54 -0700
commitf0ed6c744872ec6dc4838947ffc597f4d141864a (patch)
treec82a6cc535f94c2a1f7656b2224195d9c2b81eda /include/sys/spa.h
parent2d9142c9d4c9db4edcef4777fecfafa4832610cb (diff)
Add pool state /proc entry, "SUSPENDED" pools
1. Add a proc entry to display the pool's state: $ cat /proc/spl/kstat/zfs/tank/state ONLINE This is done without using the spa config locks, so it will never hang. 2. Fix 'zpool status' and 'zpool list -o health' output to print "SUSPENDED" instead of "ONLINE" for suspended pools. Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed by: Richard Elling <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #7331 Closes #7563
Diffstat (limited to 'include/sys/spa.h')
-rw-r--r--include/sys/spa.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sys/spa.h b/include/sys/spa.h
index 8a3938e86..e8578be9a 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -873,6 +873,7 @@ typedef struct spa_stats {
spa_stats_history_t tx_assign_histogram;
spa_stats_history_t io_history;
spa_stats_history_t mmp_history;
+ spa_stats_history_t state; /* pool state */
} spa_stats_t;
typedef enum txg_state {
@@ -1048,6 +1049,8 @@ extern void spa_history_log_internal_ds(struct dsl_dataset *ds, const char *op,
extern void spa_history_log_internal_dd(dsl_dir_t *dd, const char *operation,
dmu_tx_t *tx, const char *fmt, ...);
+extern const char *spa_state_to_name(spa_t *spa);
+
/* error handling */
struct zbookmark_phys;
extern void spa_log_error(spa_t *spa, const zbookmark_phys_t *zb);