]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/spa.c
Use cached feature info in spa_add_feature_stats()
authorNed Bass <bass6@llnl.gov>
Thu, 26 Feb 2015 20:24:11 +0000 (12:24 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 5 Mar 2015 22:11:10 +0000 (14:11 -0800)
commit417104bdd3c7ce07ec58674dd078f9891c3bc780
treed1a19daa843375394ececb2cf8098d42adaae79d
parent0e86d309ccc53e7d6093f8cf2bb09858f63267ac
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 <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3082
include/sys/spa_impl.h
module/zfs/spa.c
module/zfs/spa_misc.c
module/zfs/zfeature.c