diff --git a/zpool.go b/zpool.go index 55e221c..df9b203 100644 --- a/zpool.go +++ b/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 { diff --git a/zpool_test.go b/zpool_test.go index 54d16f1..c55382c 100644 --- a/zpool_test.go +++ b/zpool_test.go @@ -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 {