2012-12-14 03:24:15 +04:00
|
|
|
/*
|
|
|
|
* CDDL HEADER START
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
* Common Development and Distribution License (the "License").
|
|
|
|
* You may not use this file except in compliance with the License.
|
|
|
|
*
|
|
|
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
|
|
* or http://www.opensolaris.org/os/licensing.
|
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
* If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
*
|
|
|
|
* CDDL HEADER END
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2015-07-24 19:53:55 +03:00
|
|
|
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
|
2013-01-23 13:54:30 +04:00
|
|
|
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
|
2012-12-14 03:24:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ZFEATURE_COMMON_H
|
|
|
|
#define _ZFEATURE_COMMON_H
|
|
|
|
|
|
|
|
#include <sys/fs/zfs.h>
|
|
|
|
#include <sys/inttypes.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct zfeature_info;
|
|
|
|
|
2013-10-08 21:13:05 +04:00
|
|
|
typedef enum spa_feature {
|
|
|
|
SPA_FEATURE_NONE = -1,
|
|
|
|
SPA_FEATURE_ASYNC_DESTROY,
|
|
|
|
SPA_FEATURE_EMPTY_BPOBJ,
|
|
|
|
SPA_FEATURE_LZ4_COMPRESS,
|
|
|
|
SPA_FEATURE_SPACEMAP_HISTOGRAM,
|
2013-12-09 22:37:51 +04:00
|
|
|
SPA_FEATURE_ENABLED_TXG,
|
|
|
|
SPA_FEATURE_HOLE_BIRTH,
|
2013-10-08 21:13:05 +04:00
|
|
|
SPA_FEATURE_EXTENSIBLE_DATASET,
|
2014-06-06 01:19:08 +04:00
|
|
|
SPA_FEATURE_EMBEDDED_DATA,
|
2013-12-12 02:33:41 +04:00
|
|
|
SPA_FEATURE_BOOKMARKS,
|
2015-04-01 16:07:48 +03:00
|
|
|
SPA_FEATURE_FS_SS_LIMIT,
|
2014-11-03 23:15:08 +03:00
|
|
|
SPA_FEATURE_LARGE_BLOCKS,
|
2013-10-08 21:13:05 +04:00
|
|
|
SPA_FEATURES
|
|
|
|
} spa_feature_t;
|
|
|
|
|
2013-12-09 22:37:51 +04:00
|
|
|
#define SPA_FEATURE_DISABLED (-1ULL)
|
|
|
|
|
2015-07-24 19:53:55 +03:00
|
|
|
typedef enum zfeature_flags {
|
|
|
|
/* Can open pool readonly even if this feature is not supported. */
|
|
|
|
ZFEATURE_FLAG_READONLY_COMPAT = (1 << 0),
|
|
|
|
/* Is this feature necessary to read the MOS? */
|
|
|
|
ZFEATURE_FLAG_MOS = (1 << 1),
|
|
|
|
/* Activate this feature at the same time it is enabled. */
|
|
|
|
ZFEATURE_FLAG_ACTIVATE_ON_ENABLE = (1 << 2),
|
|
|
|
/* Each dataset has a field set if it has ever used this feature. */
|
|
|
|
ZFEATURE_FLAG_PER_DATASET = (1 << 3)
|
|
|
|
} zfeature_flags_t;
|
|
|
|
|
2012-12-14 03:24:15 +04:00
|
|
|
typedef struct zfeature_info {
|
2013-10-08 21:13:05 +04:00
|
|
|
spa_feature_t fi_feature;
|
2012-12-14 03:24:15 +04:00
|
|
|
const char *fi_uname; /* User-facing feature name */
|
|
|
|
const char *fi_guid; /* On-disk feature identifier */
|
|
|
|
const char *fi_desc; /* Feature description */
|
2015-07-24 19:53:55 +03:00
|
|
|
zfeature_flags_t fi_flags;
|
2013-10-08 21:13:05 +04:00
|
|
|
/* array of dependencies, terminated by SPA_FEATURE_NONE */
|
|
|
|
const spa_feature_t *fi_depends;
|
2012-12-14 03:24:15 +04:00
|
|
|
} zfeature_info_t;
|
|
|
|
|
2014-06-06 01:19:08 +04:00
|
|
|
typedef int (zfeature_func_t)(zfeature_info_t *, void *);
|
2012-12-14 03:24:15 +04:00
|
|
|
|
|
|
|
#define ZFS_FEATURE_DEBUG
|
|
|
|
|
|
|
|
extern zfeature_info_t spa_feature_table[SPA_FEATURES];
|
|
|
|
|
|
|
|
extern boolean_t zfeature_is_valid_guid(const char *);
|
|
|
|
|
|
|
|
extern boolean_t zfeature_is_supported(const char *);
|
2014-06-06 01:19:08 +04:00
|
|
|
extern int zfeature_lookup_name(const char *, spa_feature_t *);
|
|
|
|
extern boolean_t zfeature_depends_on(spa_feature_t, spa_feature_t);
|
2012-12-14 03:24:15 +04:00
|
|
|
|
|
|
|
extern void zpool_feature_init(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _ZFEATURE_COMMON_H */
|