- Constants for feature enabled/disabled
This commit is contained in:
parent
a6fba76e81
commit
5411c35d4b
16
zpool.go
16
zpool.go
|
@ -18,6 +18,12 @@ const (
|
||||||
msgPoolIsNil = "Pool handle not initialized or its closed"
|
msgPoolIsNil = "Pool handle not initialized or its closed"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Enable or disable pool feature with this constants
|
||||||
|
const (
|
||||||
|
FENABLED = "enabled"
|
||||||
|
FDISABLED = "disabled"
|
||||||
|
)
|
||||||
|
|
||||||
// PoolProperties type is map of pool properties name -> value
|
// PoolProperties type is map of pool properties name -> value
|
||||||
type PoolProperties map[Prop]string
|
type PoolProperties map[Prop]string
|
||||||
|
|
||||||
|
@ -826,6 +832,16 @@ func PoolCreate(name string, vdevs []VDevTree, features map[string]string,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable 0.6.5 features per default
|
||||||
|
features["spacemap_histogram"] = FENABLED
|
||||||
|
features["enabled_txg"] = FENABLED
|
||||||
|
features["hole_birth"] = FENABLED
|
||||||
|
features["extensible_dataset"] = FENABLED
|
||||||
|
features["embedded_data"] = FENABLED
|
||||||
|
features["bookmarks"] = FENABLED
|
||||||
|
features["filesystem_limits"] = FENABLED
|
||||||
|
features["large_blocks"] = FENABLED
|
||||||
|
|
||||||
// convert properties
|
// convert properties
|
||||||
cprops := toCPoolProperties(props)
|
cprops := toCPoolProperties(props)
|
||||||
if cprops != nil {
|
if cprops != nil {
|
||||||
|
|
|
@ -100,9 +100,9 @@ func zpoolTestPoolCreate(t *testing.T) {
|
||||||
fsprops := make(map[zfs.Prop]string)
|
fsprops := make(map[zfs.Prop]string)
|
||||||
features := make(map[string]string)
|
features := make(map[string]string)
|
||||||
fsprops[zfs.DatasetPropMountpoint] = "none"
|
fsprops[zfs.DatasetPropMountpoint] = "none"
|
||||||
features["async_destroy"] = "enabled"
|
features["async_destroy"] = zfs.FENABLED
|
||||||
features["empty_bpobj"] = "enabled"
|
features["empty_bpobj"] = zfs.FENABLED
|
||||||
features["lz4_compress"] = "enabled"
|
features["lz4_compress"] = zfs.FENABLED
|
||||||
|
|
||||||
pool, err := zfs.PoolCreate(TSTPoolName, vdevs, features, props, fsprops)
|
pool, err := zfs.PoolCreate(TSTPoolName, vdevs, features, props, fsprops)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue