diff options
author | Ned Bass <[email protected]> | 2015-02-26 12:24:11 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-03-05 14:11:10 -0800 |
commit | 417104bdd3c7ce07ec58674dd078f9891c3bc780 (patch) | |
tree | d1a19daa843375394ececb2cf8098d42adaae79d /module/zfs/zfeature.c | |
parent | 0e86d309ccc53e7d6093f8cf2bb09858f63267ac (diff) |
Use cached feature info in spa_add_feature_stats()
Avoid issuing I/O to the pool when retrieving feature flags information.
Trying to read the ZAPs from disk means that zpool clear would hang if
the pool is suspended and recovery would require a reboot. To keep the
feature stats resident in memory, we hang a cached nvlist off of the
spa. It is built up from disk the first time spa_add_feature_stats() is
called, and refreshed thereafter using the cached feature reference
counts. spa_add_feature_stats() gets called at pool import time so we
can be sure the cached nvlist will be available if the pool is later
suspended.
Signed-off-by: Ned Bass <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3082
Diffstat (limited to 'module/zfs/zfeature.c')
-rw-r--r-- | module/zfs/zfeature.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zfeature.c b/module/zfs/zfeature.c index e6cab2c03..352376f22 100644 --- a/module/zfs/zfeature.c +++ b/module/zfs/zfeature.c @@ -228,7 +228,7 @@ spa_features_check(spa_t *spa, boolean_t for_write, * * Note: well-designed features will not need to use this; they should * use spa_feature_is_enabled() and spa_feature_is_active() instead. - * However, this is non-static for zdb and zhack. + * However, this is non-static for zdb, zhack, and spa_add_feature_stats(). */ int feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res) |