summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSerapheim Dimitropoulos <[email protected]>2019-01-18 11:10:32 -0800
committerBrian Behlendorf <[email protected]>2019-01-18 11:10:32 -0800
commitb194fab0fb6caad18711abccaff3c69ad8b3f6d3 (patch)
tree7f8d8d3507dc910b505d442921b826f30b1e3e66 /cmd
parent960347d3a684a0063614eb293950f8f8c7dce7e1 (diff)
Factor metaslab_load_wait() in metaslab_load()
Most callers that need to operate on a loaded metaslab, always call metaslab_load_wait() before loading the metaslab just in case someone else is already doing the work. Factoring metaslab_load_wait() within metaslab_load() makes the later more robust, as callers won't have to do the load-wait check explicitly every time they need to load a metaslab. Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes #8290
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zdb/zdb.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index c436139a2..869b7a07f 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -910,11 +910,8 @@ dump_metaslab(metaslab_t *msp)
if (dump_opt['m'] > 2 && !dump_opt['L']) {
mutex_enter(&msp->ms_lock);
- metaslab_load_wait(msp);
- if (!msp->ms_loaded) {
- VERIFY0(metaslab_load(msp));
- range_tree_stat_verify(msp->ms_allocatable);
- }
+ VERIFY0(metaslab_load(msp));
+ range_tree_stat_verify(msp->ms_allocatable);
dump_metaslab_stats(msp);
metaslab_unload(msp);
mutex_exit(&msp->ms_lock);