From 5bc2e9e592697327cc8fdf827e49c11ad812e462 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 6 Oct 2009 12:17:38 -0700 Subject: [PATCH] Add spa_config_path module option for alternate cache file. --- module/zfs/include/sys/spa_impl.h | 2 +- module/zfs/spa_config.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/zfs/include/sys/spa_impl.h b/module/zfs/include/sys/spa_impl.h index 84da684885..8a931a0531 100644 --- a/module/zfs/include/sys/spa_impl.h +++ b/module/zfs/include/sys/spa_impl.h @@ -181,7 +181,7 @@ struct spa { refcount_t spa_refcount; /* number of opens */ }; -extern const char *spa_config_path; +extern char *spa_config_path; #define BOOTFS_COMPRESS_VALID(compress) \ ((compress) == ZIO_COMPRESS_LZJB || \ diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index a589f07584..19dca52c12 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -62,7 +62,7 @@ static uint64_t spa_config_generation = 1; * This can be overridden in userland to preserve an alternate namespace for * userland pools when doing testing. */ -const char *spa_config_path = ZPOOL_CACHE; +char *spa_config_path = ZPOOL_CACHE; /* * Called when the module is first loaded, this routine loads the configuration @@ -450,4 +450,7 @@ EXPORT_SYMBOL(spa_all_configs); EXPORT_SYMBOL(spa_config_set); EXPORT_SYMBOL(spa_config_generate); EXPORT_SYMBOL(spa_config_update); + +module_param(spa_config_path, charp, 0444); +MODULE_PARM_DESC(spa_config_path, "SPA config file (/etc/zfs/zpool.cache)"); #endif