diff usr/src/uts/common/fs/zfs/zfs_ioctl.c @ 10922:e2081f502306

PSARC 2009/571 ZFS Deduplication Properties 6677093 zfs should have dedup capability
author Jeff Bonwick <Jeff.Bonwick@Sun.COM>
date Sun, 01 Nov 2009 14:14:46 -0800
parents 8aac17999e4d
children ed9b19e85c90
line wrap: on
line diff
--- a/usr/src/uts/common/fs/zfs/zfs_ioctl.c	Fri Oct 30 18:47:17 2009 -0600
+++ b/usr/src/uts/common/fs/zfs/zfs_ioctl.c	Sun Nov 01 14:14:46 2009 -0800
@@ -41,7 +41,6 @@
 #include <sys/spa.h>
 #include <sys/spa_impl.h>
 #include <sys/vdev.h>
-#include <sys/vdev_impl.h>
 #include <sys/dmu.h>
 #include <sys/dsl_dir.h>
 #include <sys/dsl_dataset.h>
@@ -179,7 +178,7 @@
 
 	if (dmu_objset_hold(name, FTAG, &os) == 0) {
 		boolean_t ret;
-		ret = (dmu_objset_id(os) == dmu_objset_spa(os)->spa_bootfs);
+		ret = (dmu_objset_id(os) == spa_bootfs(dmu_objset_spa(os)));
 		dmu_objset_rele(os, FTAG);
 		return (ret);
 	}
@@ -1219,7 +1218,7 @@
 	 *
 	 * l2cache and spare devices are ok to be added to a rootpool.
 	 */
-	if (spa->spa_bootfs != 0 && nl2cache == 0 && nspares == 0) {
+	if (spa_bootfs(spa) != 0 && nl2cache == 0 && nspares == 0) {
 		spa_close(spa, FTAG);
 		return (EDOM);
 	}
@@ -1665,6 +1664,11 @@
 				    SPA_VERSION_GZIP_COMPRESSION))
 					return (ENOTSUP);
 
+				if (intval == ZIO_COMPRESS_ZLE &&
+				    zfs_earlier_version(name,
+				    SPA_VERSION_ZLE_COMPRESSION))
+					return (ENOTSUP);
+
 				/*
 				 * If this is a bootable dataset then
 				 * verify that the compression algorithm
@@ -1683,6 +1687,11 @@
 				return (ENOTSUP);
 			break;
 
+		case ZFS_PROP_DEDUP:
+			if (zfs_earlier_version(name, SPA_VERSION_DEDUP))
+				return (ENOTSUP);
+			break;
+
 		case ZFS_PROP_SHARESMB:
 			if (zpl_earlier_version(name, ZPL_VERSION_FUID))
 				return (ENOTSUP);
@@ -2978,9 +2987,9 @@
 		mutex_exit(&spa_namespace_lock);
 		return (EIO);
 	}
-	if (spa->spa_log_state == SPA_LOG_MISSING) {
+	if (spa_get_log_state(spa) == SPA_LOG_MISSING) {
 		/* we need to let spa_open/spa_load clear the chains */
-		spa->spa_log_state = SPA_LOG_CLEAR;
+		spa_set_log_state(spa, SPA_LOG_CLEAR);
 	}
 	spa->spa_last_open_failed = 0;
 	mutex_exit(&spa_namespace_lock);