mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com> Closes #8290
This commit is contained in:
committed by
Brian Behlendorf
parent
960347d3a6
commit
b194fab0fb
@@ -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 *);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user