aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/include')
-rw-r--r--sys/contrib/openzfs/include/libzfs.h16
-rw-r--r--sys/contrib/openzfs/include/sys/fs/zfs.h19
-rw-r--r--sys/contrib/openzfs/include/sys/spa_impl.h2
-rw-r--r--sys/contrib/openzfs/include/zfeature_common.h2
4 files changed, 35 insertions, 4 deletions
diff --git a/sys/contrib/openzfs/include/libzfs.h b/sys/contrib/openzfs/include/libzfs.h
index 66cedd0ee0fe..5f0bc03be144 100644
--- a/sys/contrib/openzfs/include/libzfs.h
+++ b/sys/contrib/openzfs/include/libzfs.h
@@ -28,6 +28,7 @@
* Copyright 2016 Nexenta Systems, Inc.
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
* Copyright (c) 2019 Datto Inc.
+ * Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
*/
#ifndef _LIBZFS_H
@@ -391,6 +392,7 @@ typedef enum {
ZPOOL_STATUS_REBUILDING, /* device being rebuilt */
ZPOOL_STATUS_REBUILD_SCRUB, /* recommend scrubbing the pool */
ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */
+ ZPOOL_STATUS_COMPATIBILITY_ERR, /* bad 'compatibility' property */
/*
* Finally, the following indicates a healthy pool.
@@ -912,6 +914,20 @@ int zfs_smb_acl_rename(libzfs_handle_t *, char *, char *, char *, char *);
extern int zpool_enable_datasets(zpool_handle_t *, const char *, int);
extern int zpool_disable_datasets(zpool_handle_t *, boolean_t);
+/*
+ * Parse a features file for -o compatibility
+ */
+typedef enum {
+ ZPOOL_COMPATIBILITY_OK,
+ ZPOOL_COMPATIBILITY_READERR,
+ ZPOOL_COMPATIBILITY_BADFILE,
+ ZPOOL_COMPATIBILITY_BADWORD,
+ ZPOOL_COMPATIBILITY_NOFILES
+} zpool_compat_status_t;
+
+extern zpool_compat_status_t zpool_load_compat(const char *,
+ boolean_t *, char *, char *);
+
#ifdef __FreeBSD__
/*
diff --git a/sys/contrib/openzfs/include/sys/fs/zfs.h b/sys/contrib/openzfs/include/sys/fs/zfs.h
index 65515e3829f3..71d736d5cc97 100644
--- a/sys/contrib/openzfs/include/sys/fs/zfs.h
+++ b/sys/contrib/openzfs/include/sys/fs/zfs.h
@@ -27,10 +27,10 @@
* Copyright (c) 2014 Integros [integros.com]
* Copyright (c) 2017, Intel Corporation.
* Copyright (c) 2019 Datto Inc.
+ * Portions Copyright 2010 Robert Milkowski
+ * Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
*/
-/* Portions Copyright 2010 Robert Milkowski */
-
#ifndef _SYS_FS_ZFS_H
#define _SYS_FS_ZFS_H
@@ -246,6 +246,7 @@ typedef enum {
ZPOOL_PROP_CHECKPOINT,
ZPOOL_PROP_LOAD_GUID,
ZPOOL_PROP_AUTOTRIM,
+ ZPOOL_PROP_COMPATIBILITY,
ZPOOL_NUM_PROPS
} zpool_prop_t;
@@ -733,6 +734,7 @@ typedef struct zpool_load_policy {
#define ZPOOL_CONFIG_ALLOCATION_BIAS "alloc_bias" /* not stored on disk */
#define ZPOOL_CONFIG_EXPANSION_TIME "expansion_time" /* not stored */
#define ZPOOL_CONFIG_REBUILD_STATS "org.openzfs:rebuild_stats"
+#define ZPOOL_CONFIG_COMPATIBILITY "compatibility"
/*
* The persistent vdev state is stored as separate values rather than a single
@@ -846,6 +848,19 @@ typedef struct zpool_load_policy {
#define ZPOOL_CACHE_BOOT "/boot/zfs/zpool.cache"
#define ZPOOL_CACHE "/etc/zfs/zpool.cache"
/*
+ * Settings for zpool compatibility features files
+ */
+#define ZPOOL_SYSCONF_COMPAT_D SYSCONFDIR "/zfs/compatibility.d"
+#define ZPOOL_DATA_COMPAT_D PKGDATADIR "/compatibility.d"
+#define ZPOOL_COMPAT_MAXSIZE 16384
+
+/*
+ * Hard-wired compatibility settings
+ */
+#define ZPOOL_COMPAT_LEGACY "legacy"
+#define ZPOOL_COMPAT_OFF "off"
+
+/*
* vdev states are ordered from least to most healthy.
* A vdev that's CANT_OPEN or below is considered unusable.
*/
diff --git a/sys/contrib/openzfs/include/sys/spa_impl.h b/sys/contrib/openzfs/include/sys/spa_impl.h
index 7f15fd030faa..bc88cfa15e8e 100644
--- a/sys/contrib/openzfs/include/sys/spa_impl.h
+++ b/sys/contrib/openzfs/include/sys/spa_impl.h
@@ -424,6 +424,8 @@ struct spa {
int spa_waiters; /* number of waiting threads */
boolean_t spa_waiters_cancel; /* waiters should return */
+ char *spa_compatibility; /* compatibility file(s) */
+
/*
* spa_refcount & spa_config_lock must be the last elements
* because zfs_refcount_t changes size based on compilation options.
diff --git a/sys/contrib/openzfs/include/zfeature_common.h b/sys/contrib/openzfs/include/zfeature_common.h
index cf05bad76c3c..76dd7ed57478 100644
--- a/sys/contrib/openzfs/include/zfeature_common.h
+++ b/sys/contrib/openzfs/include/zfeature_common.h
@@ -56,9 +56,7 @@ typedef enum spa_feature {
SPA_FEATURE_LARGE_DNODE,
SPA_FEATURE_SHA512,
SPA_FEATURE_SKEIN,
-#if !defined(__FreeBSD__)
SPA_FEATURE_EDONR,
-#endif
SPA_FEATURE_USEROBJ_ACCOUNTING,
SPA_FEATURE_ENCRYPTION,
SPA_FEATURE_PROJECT_QUOTA,