summaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/sys/metaslab.h1
-rw-r--r--include/sys/metaslab_impl.h4
2 files changed, 2 insertions, 3 deletions
diff --git a/include/sys/metaslab.h b/include/sys/metaslab.h
index fca233a38..f47bc19cf 100644
--- a/include/sys/metaslab.h
+++ b/include/sys/metaslab.h
@@ -49,7 +49,6 @@ int metaslab_init(metaslab_group_t *, uint64_t, uint64_t, uint64_t,
metaslab_t **);
void metaslab_fini(metaslab_t *);
-void metaslab_load_wait(metaslab_t *);
int metaslab_load(metaslab_t *);
void metaslab_unload(metaslab_t *);
diff --git a/include/sys/metaslab_impl.h b/include/sys/metaslab_impl.h
index 3e32eace6..137a84769 100644
--- a/include/sys/metaslab_impl.h
+++ b/include/sys/metaslab_impl.h
@@ -369,8 +369,8 @@ struct metaslab {
uint64_t ms_initializing; /* leaves initializing this ms */
/*
- * We must hold both ms_lock and ms_group->mg_lock in order to
- * modify ms_loaded.
+ * We must always hold the ms_lock when modifying ms_loaded
+ * and ms_loading.
*/
boolean_t ms_loaded;
boolean_t ms_loading;