5149 zvols need a way to ignore DKIOCFREE

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <matthew.ahrens@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

illumos/illumos-gate@893c83ba3e
This commit is contained in:
Xin LI 2014-10-04 07:37:17 +00:00
parent f9fa0a788c
commit 1cf573be37

View File

@ -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 arg, int flag, cred_t *cr, int *rvalp)
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;