summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPavel Zakharov <[email protected]>2017-02-10 17:51:09 -0500
committerBrian Behlendorf <[email protected]>2018-06-04 14:54:20 -0700
commit8a393be353c3bfffbfbe0f4d2bc57210b658dcde (patch)
tree11a6990472970d151bed08414b7d86feb173777b /include
parent85912983a4ff12eab20b170c15eb26f7761b8be2 (diff)
OpenZFS 9235 - rename zpool_rewind_policy_t to zpool_load_policy_t
We want to be able to pass various settings during import/open of a pool, which are not only related to rewind. Instead of adding a new policy and duplicate a bunch of code, we should just rename rewind_policy to a more generic term like load_policy. For instance, we'd like to set spa->spa_import_flags from the nvlist, rather from a flags parameter passed to spa_import as in some cases we want those flags not only for the import case, but also for the open case. One such flag could be ZFS_IMPORT_MISSING_LOG (as used in zdb) which would allow zfs to open a pool when logs are missing. Authored by: Pavel Zakharov <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://illumos.org/issues/9235 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/d2b1e44 Closes #7532
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h2
-rw-r--r--include/sys/fs/zfs.h26
-rw-r--r--include/zfs_comutil.h4
3 files changed, 16 insertions, 16 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 45eb5c904..7ea6d7fa0 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -413,7 +413,7 @@ typedef struct importargs {
int unique : 1; /* does 'poolname' already exist? */
int exists : 1; /* set on return if pool already exists */
int scan : 1; /* prefer scanning to libblkid cache */
- nvlist_t *policy; /* rewind policy (rewind txg, etc.) */
+ nvlist_t *policy; /* load policy (max txg, rewind, etc.) */
} importargs_t;
extern nvlist_t *zpool_search_import(libzfs_handle_t *, importargs_t *);
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index fa4eb2721..870618ecb 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -570,7 +570,7 @@ typedef enum zfs_key_location {
#define ZPL_VERSION_USERSPACE ZPL_VERSION_4
#define ZPL_VERSION_SA ZPL_VERSION_5
-/* Rewind request information */
+/* Rewind policy information */
#define ZPOOL_NO_REWIND 1 /* No policy - default behavior */
#define ZPOOL_NEVER_REWIND 2 /* Do not search for best txg or rewind */
#define ZPOOL_TRY_REWIND 4 /* Search for best txg, but do not rewind */
@@ -579,12 +579,12 @@ typedef enum zfs_key_location {
#define ZPOOL_REWIND_MASK 28 /* All the possible rewind bits */
#define ZPOOL_REWIND_POLICIES 31 /* All the possible policy bits */
-typedef struct zpool_rewind_policy {
- uint32_t zrp_request; /* rewind behavior requested */
- uint64_t zrp_maxmeta; /* max acceptable meta-data errors */
- uint64_t zrp_maxdata; /* max acceptable data errors */
- uint64_t zrp_txg; /* specific txg to load */
-} zpool_rewind_policy_t;
+typedef struct zpool_load_policy {
+ uint32_t zlp_rewind; /* rewind policy requested */
+ uint64_t zlp_maxmeta; /* max acceptable meta-data errors */
+ uint64_t zlp_maxdata; /* max acceptable data errors */
+ uint64_t zlp_txg; /* specific txg to load */
+} zpool_load_policy_t;
/*
* The following are configuration names used in the nvlist describing a pool's
@@ -722,12 +722,12 @@ typedef struct zpool_rewind_policy {
#define ZPOOL_CONFIG_FRU "fru"
#define ZPOOL_CONFIG_AUX_STATE "aux_state"
-/* Rewind policy parameters */
-#define ZPOOL_REWIND_POLICY "rewind-policy"
-#define ZPOOL_REWIND_REQUEST "rewind-request"
-#define ZPOOL_REWIND_REQUEST_TXG "rewind-request-txg"
-#define ZPOOL_REWIND_META_THRESH "rewind-meta-thresh"
-#define ZPOOL_REWIND_DATA_THRESH "rewind-data-thresh"
+/* Pool load policy parameters */
+#define ZPOOL_LOAD_POLICY "load-policy"
+#define ZPOOL_LOAD_REWIND_POLICY "load-rewind-policy"
+#define ZPOOL_LOAD_REQUEST_TXG "load-request-txg"
+#define ZPOOL_LOAD_META_THRESH "load-meta-thresh"
+#define ZPOOL_LOAD_DATA_THRESH "load-data-thresh"
/* Rewind data discovered */
#define ZPOOL_CONFIG_LOAD_TIME "rewind_txg_ts"
diff --git a/include/zfs_comutil.h b/include/zfs_comutil.h
index f89054388..8cc098ada 100644
--- a/include/zfs_comutil.h
+++ b/include/zfs_comutil.h
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
*/
#ifndef _ZFS_COMUTIL_H
@@ -34,7 +34,7 @@ extern "C" {
#endif
extern boolean_t zfs_allocatable_devs(nvlist_t *);
-extern void zpool_get_rewind_policy(nvlist_t *, zpool_rewind_policy_t *);
+extern void zpool_get_load_policy(nvlist_t *, zpool_load_policy_t *);
extern int zfs_zpl_version_map(int spa_version);
extern int zfs_spa_version_map(int zpl_version);