summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r--module/zfs/spa.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 9bfd24d98..0eb4910af 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -319,7 +319,7 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp)
spa_prop_add_list(*nvp, ZPOOL_PROP_EXPANDSZ, NULL,
metaslab_class_expandable_space(mc), src);
spa_prop_add_list(*nvp, ZPOOL_PROP_READONLY, NULL,
- (spa_mode(spa) == FREAD), src);
+ (spa_mode(spa) == SPA_MODE_READ), src);
cap = (size == 0) ? 0 : (alloc * 100 / size);
spa_prop_add_list(*nvp, ZPOOL_PROP_CAPACITY, NULL, cap, src);
@@ -1196,7 +1196,7 @@ spa_thread(void *arg)
* Activate an uninitialized pool.
*/
static void
-spa_activate(spa_t *spa, int mode)
+spa_activate(spa_t *spa, spa_mode_t mode)
{
ASSERT(spa->spa_state == POOL_STATE_UNINITIALIZED);
@@ -3362,7 +3362,7 @@ spa_ld_open_vdevs(spa_t *spa)
if (spa->spa_missing_tvds != 0) {
spa_load_note(spa, "vdev tree has %lld missing top-level "
"vdevs.", (u_longlong_t)spa->spa_missing_tvds);
- if (spa->spa_trust_config && (spa->spa_mode & FWRITE)) {
+ if (spa->spa_trust_config && (spa->spa_mode & SPA_MODE_WRITE)) {
/*
* Although theoretically we could allow users to open
* incomplete pools in RW mode, we'd need to add a lot
@@ -4358,7 +4358,7 @@ spa_ld_check_for_config_update(spa_t *spa, uint64_t config_cache_txg,
static void
spa_ld_prepare_for_reload(spa_t *spa)
{
- int mode = spa->spa_mode;
+ spa_mode_t mode = spa->spa_mode;
int async_suspended = spa->spa_async_suspended;
spa_unload(spa);
@@ -4868,7 +4868,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
static int
spa_load_retry(spa_t *spa, spa_load_state_t state)
{
- int mode = spa->spa_mode;
+ spa_mode_t mode = spa->spa_mode;
spa_unload(spa);
spa_deactivate(spa);
@@ -5915,7 +5915,7 @@ spa_import(char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
char *altroot = NULL;
spa_load_state_t state = SPA_LOAD_IMPORT;
zpool_load_policy_t policy;
- uint64_t mode = spa_mode_global;
+ spa_mode_t mode = spa_mode_global;
uint64_t readonly = B_FALSE;
int error;
nvlist_t *nvroot;
@@ -5939,7 +5939,7 @@ spa_import(char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
(void) nvlist_lookup_uint64(props,
zpool_prop_to_name(ZPOOL_PROP_READONLY), &readonly);
if (readonly)
- mode = FREAD;
+ mode = SPA_MODE_READ;
spa = spa_add(pool, config, altroot);
spa->spa_import_flags = flags;
@@ -6109,7 +6109,7 @@ spa_tryimport(nvlist_t *tryconfig)
*/
mutex_enter(&spa_namespace_lock);
spa = spa_add(TRYIMPORT_NAME, tryconfig, NULL);
- spa_activate(spa, FREAD);
+ spa_activate(spa, SPA_MODE_READ);
/*
* Rewind pool if a max txg was provided.
@@ -6219,7 +6219,7 @@ spa_export_common(char *pool, int new_state, nvlist_t **oldconfig,
if (oldconfig)
*oldconfig = NULL;
- if (!(spa_mode_global & FWRITE))
+ if (!(spa_mode_global & SPA_MODE_WRITE))
return (SET_ERROR(EROFS));
mutex_enter(&spa_namespace_lock);
@@ -8073,8 +8073,7 @@ spa_async_dispatch(spa_t *spa)
mutex_enter(&spa->spa_async_lock);
if (spa_async_tasks_pending(spa) &&
!spa->spa_async_suspended &&
- spa->spa_async_thread == NULL &&
- rootdir != NULL)
+ spa->spa_async_thread == NULL)
spa->spa_async_thread = thread_create(NULL, 0,
spa_async_thread, spa, 0, &p0, TS_RUN, maxclsyspri);
mutex_exit(&spa->spa_async_lock);