diff options
author | delphij <delphij@FreeBSD.org> | 2014-07-15 05:42:09 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-07-15 05:42:09 +0000 |
commit | 4af6f088fb20b549ad05b7a5c54c4a56e4961d30 (patch) | |
tree | 1510ca8f275d04bcde0105acc3d460f5c21e3f56 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c | |
parent | 5cce10db7bcae4a96a6910d12d48309059f48318 (diff) | |
download | FreeBSD-src-4af6f088fb20b549ad05b7a5c54c4a56e4961d30.zip FreeBSD-src-4af6f088fb20b549ad05b7a5c54c4a56e4961d30.tar.gz |
MFC r268126: MFV r268121:
4924 LZ4 Compression for metadata
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c index afc240b..ed09edc 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2013, 2014, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved. */ @@ -6429,6 +6429,22 @@ spa_sync_upgrades(spa_t *spa, dmu_tx_t *tx) spa->spa_uberblock.ub_version >= SPA_VERSION_FEATURES) { spa_feature_create_zap_objects(spa, tx); } + + /* + * LZ4_COMPRESS feature's behaviour was changed to activate_on_enable + * when possibility to use lz4 compression for metadata was added + * Old pools that have this feature enabled must be upgraded to have + * this feature active + */ + if (spa->spa_uberblock.ub_version >= SPA_VERSION_FEATURES) { + boolean_t lz4_en = spa_feature_is_enabled(spa, + SPA_FEATURE_LZ4_COMPRESS); + boolean_t lz4_ac = spa_feature_is_active(spa, + SPA_FEATURE_LZ4_COMPRESS); + + if (lz4_en && !lz4_ac) + spa_feature_incr(spa, SPA_FEATURE_LZ4_COMPRESS, tx); + } rrw_exit(&dp->dp_config_rwlock, FTAG); } |