svn commit: r272498 - vendor-sys/illumos/dist/uts/common/fs/zfs

Xin LI delphij at FreeBSD.org
Sat Oct 4 07:37:18 UTC 2014


Author: delphij
Date: Sat Oct  4 07:37:17 2014
New Revision: 272498
URL: https://svnweb.freebsd.org/changeset/base/272498

Log:
  5149 zvols need a way to ignore DKIOCFREE
  Reviewed by: Adam Leventhal <ahl at delphix.com>
  Reviewed by: Matthew Ahrens <matthew.ahrens at delphix.com>
  Reviewed by: Sebastien Roy <sebastien.roy at delphix.com>
  Reviewed by: Dan McDonald <danmcd at omniti.com>
  Reviewed by: Saso Kiselkov <skiselkov.ml at gmail.com>
  Approved by: Robert Mustacchi <rm at joyent.com>
  Author: George Wilson <george.wilson at delphix.com>
  
  illumos/illumos-gate at 893c83ba3e1c87a785b5274ce2ef02f45fba6087

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c	Sat Oct  4 07:35:50 2014	(r272497)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c	Sat Oct  4 07:37:17 2014	(r272498)
@@ -142,6 +142,11 @@ typedef struct zvol_state {
  */
 int zvol_maxphys = DMU_MAX_ACCESS/2;
 
+/*
+ * Toggle unmap functionality.
+ */
+boolean_t zvol_unmap_enabled = B_TRUE;
+
 extern int zfs_set_prop_nvlist(const char *, zprop_source_t,
     nvlist_t *, nvlist_t *);
 static int zvol_remove_zv(zvol_state_t *);
@@ -1769,6 +1774,9 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t 
 		dkioc_free_t df;
 		dmu_tx_t *tx;
 
+		if (!zvol_unmap_enabled)
+			break;
+
 		if (ddi_copyin((void *)arg, &df, sizeof (df), flag)) {
 			error = SET_ERROR(EFAULT);
 			break;


More information about the svn-src-all mailing list