aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/spa.c
diff options
context:
space:
mode:
authorDaniil Lunev <[email protected]>2014-10-18 11:58:11 -0400
committerBrian Behlendorf <[email protected]>2014-10-20 16:17:49 -0700
commit62bdd5eb7a35288cc25c5ae968bcd0f08889f986 (patch)
tree35760de9fb45f308b375401b99a919aeb1ccaeb3 /module/zfs/spa.c
parentba232d8aead62e2af9c195c2802b89dbc891d5ef (diff)
Illumos 4924 - LZ4 Compression for metadata
Reviewed by Matthew Ahrens <[email protected]> Reviewed by Saso Kiselkov <[email protected]> Approved by: Christopher Siden <[email protected]> References: https://github.com/illumos/illumos-gate/commit/b8289d2 https://www.illumos.org/issues/3756 Porting notes: The static function zfs_prop_activate_feature() was removed because this change removes the only caller. The function was not removed from Illumos but instead left as dead code. However, to keep gcc happy it was removed from Linux and may be easily restored if needed. Ported by: DHE <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1540
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r--module/zfs/spa.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 1b1bf7a5c..776beda11 100644
--- a/module/zfs/spa.c
+++ b/module/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.
*/
/*
@@ -6209,6 +6209,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);
}