]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/spa_config.c
OpenZFS 7614, 9064 - zfs device evacuation/removal
[mirror_zfs.git] / module / zfs / spa_config.c
index 0ee46c2f28b0c6c2cf9971b28a33858d7df35dc0..4e9fd6c575ff5f50aabbbda088874f478568ac5c 100644 (file)
@@ -55,7 +55,7 @@
  * configuration information.  When the module loads, we read this information
  * from /etc/zfs/zpool.cache and populate the SPA namespace.  This namespace is
  * maintained independently in spa.c.  Whenever the namespace is modified, or
- * the configuration of a pool is changed, we call spa_config_sync(), which
+ * the configuration of a pool is changed, we call spa_write_cachefile(), which
  * walks through all the active pools and writes the configuration to disk.
  */
 
@@ -249,7 +249,7 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl)
  * would be required.
  */
 void
-spa_config_sync(spa_t *target, boolean_t removing, boolean_t postsysevent)
+spa_write_cachefile(spa_t *target, boolean_t removing, boolean_t postsysevent)
 {
        spa_config_dirent_t *dp, *tdp;
        nvlist_t *nvl;
@@ -413,7 +413,6 @@ spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t txg, int getstats)
        boolean_t locked = B_FALSE;
        uint64_t split_guid;
        char *pool_name;
-       int config_gen_flags = 0;
 
        if (vd == NULL) {
                vd = rvd;
@@ -463,6 +462,7 @@ spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t txg, int getstats)
                fnvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID, hostid);
        fnvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME, utsname()->nodename);
 
+       int config_gen_flags = 0;
        if (vd != rvd) {
                fnvlist_add_uint64(config, ZPOOL_CONFIG_TOP_GUID,
                    vd->vdev_top->vdev_guid);
@@ -590,15 +590,16 @@ spa_config_update(spa_t *spa, int what)
        /*
         * Update the global config cache to reflect the new mosconfig.
         */
-       if (!spa->spa_is_root)
-               spa_config_sync(spa, B_FALSE, what != SPA_CONFIG_UPDATE_POOL);
+       if (!spa->spa_is_root) {
+               spa_write_cachefile(spa, B_FALSE,
+                   what != SPA_CONFIG_UPDATE_POOL);
+       }
 
        if (what == SPA_CONFIG_UPDATE_POOL)
                spa_config_update(spa, SPA_CONFIG_UPDATE_VDEVS);
 }
 
 #if defined(_KERNEL) && defined(HAVE_SPL)
-EXPORT_SYMBOL(spa_config_sync);
 EXPORT_SYMBOL(spa_config_load);
 EXPORT_SYMBOL(spa_all_configs);
 EXPORT_SYMBOL(spa_config_set);