diff options
author | mav <mav@FreeBSD.org> | 2015-10-03 07:23:19 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-03 07:23:19 +0000 |
commit | 1762d85b037dd1919c3d2a0c0ca556ec6abb0d94 (patch) | |
tree | cee825a6563d1f9e1d9b689576db4329ea1236e2 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c | |
parent | 53fc33bdada52f555b8b55b9e07bfdc004df4c44 (diff) | |
download | FreeBSD-src-1762d85b037dd1919c3d2a0c0ca556ec6abb0d94.zip FreeBSD-src-1762d85b037dd1919c3d2a0c0ca556ec6abb0d94.tar.gz |
MFC r286547:
5661 ZFS: "compression = on" should use lz4 if feature is enabled
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Xin LI <delphij@freebsd.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Justin T. Gibbs <justing@spectralogic.com>
illumos/illumos-gate@db1741f555ec79def5e9846e6bfd132248514ffe
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c index edd6d81..1e4a9b1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c @@ -1785,19 +1785,15 @@ dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp) * 3. all other level 0 blocks */ if (ismd) { - /* - * XXX -- we should design a compression algorithm - * that specializes in arrays of bps. - */ - boolean_t lz4_ac = spa_feature_is_active(os->os_spa, - SPA_FEATURE_LZ4_COMPRESS); - if (zfs_mdcomp_disable) { compress = ZIO_COMPRESS_EMPTY; - } else if (lz4_ac) { - compress = ZIO_COMPRESS_LZ4; } else { - compress = ZIO_COMPRESS_LZJB; + /* + * XXX -- we should design a compression algorithm + * that specializes in arrays of bps. + */ + compress = zio_compress_select(os->os_spa, + ZIO_COMPRESS_ON, ZIO_COMPRESS_ON); } /* @@ -1830,7 +1826,8 @@ dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp) compress = ZIO_COMPRESS_OFF; checksum = ZIO_CHECKSUM_NOPARITY; } else { - compress = zio_compress_select(dn->dn_compress, compress); + compress = zio_compress_select(os->os_spa, dn->dn_compress, + compress); checksum = (dedup_checksum == ZIO_CHECKSUM_OFF) ? zio_checksum_select(dn->dn_checksum, checksum) : |