mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Illumos 5661 - ZFS: "compression = on" should use lz4 if feature is enabled
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> References: https://github.com/illumos/illumos-gate/commit/db1741f https://www.illumos.org/issues/5661 Ported-by: kernelOfTruth kerneloftruth@gmail.com Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3571
This commit is contained in:
committed by
Brian Behlendorf
parent
15cfbb38fd
commit
99197f034e
+8
-11
@@ -1864,19 +1864,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);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1909,7 +1905,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_OFF;
|
||||
} 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) :
|
||||
|
||||
Reference in New Issue
Block a user