- 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"
|
||||
)
|
||||
|
||||
// Enable or disable pool feature with this constants
|
||||
const (
|
||||
FENABLED = "enabled"
|
||||
FDISABLED = "disabled"
|
||||
)
|
||||
|
||||
// PoolProperties type is map of pool properties name -> value
|
||||
type PoolProperties map[Prop]string
|
||||
|
||||
|
@ -826,6 +832,16 @@ func PoolCreate(name string, vdevs []VDevTree, features map[string]string,
|
|||
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
|
||||
cprops := toCPoolProperties(props)
|
||||
if cprops != nil {
|
||||
|
|
|
@ -100,9 +100,9 @@ func zpoolTestPoolCreate(t *testing.T) {
|
|||
fsprops := make(map[zfs.Prop]string)
|
||||
features := make(map[string]string)
|
||||
fsprops[zfs.DatasetPropMountpoint] = "none"
|
||||
features["async_destroy"] = "enabled"
|
||||
features["empty_bpobj"] = "enabled"
|
||||
features["lz4_compress"] = "enabled"
|
||||
features["async_destroy"] = zfs.FENABLED
|
||||
features["empty_bpobj"] = zfs.FENABLED
|
||||
features["lz4_compress"] = zfs.FENABLED
|
||||
|
||||
pool, err := zfs.PoolCreate(TSTPoolName, vdevs, features, props, fsprops)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue