Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | compression_changed_cb(void *arg, uint64_t newval) | ||||
*/ | */ | ||||
ASSERT(newval != ZIO_COMPRESS_INHERIT); | ASSERT(newval != ZIO_COMPRESS_INHERIT); | ||||
os->os_compress = zio_compress_select(os->os_spa, newval, | os->os_compress = zio_compress_select(os->os_spa, newval, | ||||
ZIO_COMPRESS_ON); | ZIO_COMPRESS_ON); | ||||
} | } | ||||
static void | static void | ||||
zstd_level_changed_cb(void *arg, uint64_t newval) | |||||
{ | |||||
objset_t *os = arg; | |||||
/* | |||||
* Inheritance and range checking should have been done by now. | |||||
*/ | |||||
/* XXX: Changing from inherited zstd to gzip trips this assert */ | |||||
//ASSERT(newval != ZIO_ZSTDLVL_INHERIT); | |||||
os->os_zstd_level = zio_zstd_level_select(os->os_spa, newval, | |||||
ZIO_ZSTDLVL_DEFAULT); | |||||
} | |||||
static void | |||||
copies_changed_cb(void *arg, uint64_t newval) | copies_changed_cb(void *arg, uint64_t newval) | ||||
{ | { | ||||
objset_t *os = arg; | objset_t *os = arg; | ||||
/* | /* | ||||
* Inheritance and range checking should have been done by now. | * Inheritance and range checking should have been done by now. | ||||
*/ | */ | ||||
ASSERT(newval > 0); | ASSERT(newval > 0); | ||||
▲ Show 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | if (!ds->ds_is_snapshot) { | ||||
} | } | ||||
if (err == 0) { | if (err == 0) { | ||||
err = dsl_prop_register(ds, | err = dsl_prop_register(ds, | ||||
zfs_prop_to_name(ZFS_PROP_COMPRESSION), | zfs_prop_to_name(ZFS_PROP_COMPRESSION), | ||||
compression_changed_cb, os); | compression_changed_cb, os); | ||||
} | } | ||||
if (err == 0) { | if (err == 0) { | ||||
err = dsl_prop_register(ds, | err = dsl_prop_register(ds, | ||||
zfs_prop_to_name(ZFS_PROP_ZSTD_LEVEL), | |||||
zstd_level_changed_cb, os); | |||||
} | |||||
if (err == 0) { | |||||
err = dsl_prop_register(ds, | |||||
zfs_prop_to_name(ZFS_PROP_COPIES), | zfs_prop_to_name(ZFS_PROP_COPIES), | ||||
copies_changed_cb, os); | copies_changed_cb, os); | ||||
} | } | ||||
if (err == 0) { | if (err == 0) { | ||||
err = dsl_prop_register(ds, | err = dsl_prop_register(ds, | ||||
zfs_prop_to_name(ZFS_PROP_DEDUP), | zfs_prop_to_name(ZFS_PROP_DEDUP), | ||||
dedup_changed_cb, os); | dedup_changed_cb, os); | ||||
} | } | ||||
Show All 25 Lines | if (err != 0) { | ||||
arc_buf_destroy(os->os_phys_buf, &os->os_phys_buf); | arc_buf_destroy(os->os_phys_buf, &os->os_phys_buf); | ||||
kmem_free(os, sizeof (objset_t)); | kmem_free(os, sizeof (objset_t)); | ||||
return (err); | return (err); | ||||
} | } | ||||
} else { | } else { | ||||
/* It's the meta-objset. */ | /* It's the meta-objset. */ | ||||
os->os_checksum = ZIO_CHECKSUM_FLETCHER_4; | os->os_checksum = ZIO_CHECKSUM_FLETCHER_4; | ||||
os->os_compress = ZIO_COMPRESS_ON; | os->os_compress = ZIO_COMPRESS_ON; | ||||
os->os_zstd_level = ZIO_ZSTDLVL_DEFAULT; | |||||
os->os_copies = spa_max_replication(spa); | os->os_copies = spa_max_replication(spa); | ||||
os->os_dedup_checksum = ZIO_CHECKSUM_OFF; | os->os_dedup_checksum = ZIO_CHECKSUM_OFF; | ||||
os->os_dedup_verify = B_FALSE; | os->os_dedup_verify = B_FALSE; | ||||
os->os_logbias = ZFS_LOGBIAS_LATENCY; | os->os_logbias = ZFS_LOGBIAS_LATENCY; | ||||
os->os_sync = ZFS_SYNC_STANDARD; | os->os_sync = ZFS_SYNC_STANDARD; | ||||
os->os_primary_cache = ZFS_CACHE_ALL; | os->os_primary_cache = ZFS_CACHE_ALL; | ||||
os->os_secondary_cache = ZFS_CACHE_ALL; | os->os_secondary_cache = ZFS_CACHE_ALL; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,849 Lines • Show Last 20 Lines |