- /*
- * If we are resizing the dump device then we only need to
- * update the refreservation to match the newly updated
- * zvolsize. Otherwise, we save off the original state of the
- * zvol so that we can restore them if the zvol is ever undumpified.
- */
- if (resize) {
- error = zap_update(os, ZVOL_ZAP_OBJ,
- zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1,
- &zv->zv_volsize, tx);
- } else {
- uint64_t checksum, compress, refresrv, vbs;
-
- error = dsl_prop_get_integer(zv->zv_name,
- zfs_prop_to_name(ZFS_PROP_COMPRESSION), &compress, NULL);
- error = error ? error : dsl_prop_get_integer(zv->zv_name,
- zfs_prop_to_name(ZFS_PROP_CHECKSUM), &checksum, NULL);
- error = error ? error : dsl_prop_get_integer(zv->zv_name,
- zfs_prop_to_name(ZFS_PROP_REFRESERVATION), &refresrv, NULL);
- error = error ? error : dsl_prop_get_integer(zv->zv_name,
- zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), &vbs, NULL);
-
- error = error ? error : zap_update(os, ZVOL_ZAP_OBJ,
- zfs_prop_to_name(ZFS_PROP_COMPRESSION), 8, 1,
- &compress, tx);
- error = error ? error : zap_update(os, ZVOL_ZAP_OBJ,
- zfs_prop_to_name(ZFS_PROP_CHECKSUM), 8, 1, &checksum, tx);
- error = error ? error : zap_update(os, ZVOL_ZAP_OBJ,
- zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1,
- &refresrv, tx);
- error = error ? error : zap_update(os, ZVOL_ZAP_OBJ,
- zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), 8, 1,
- &vbs, tx);
- }
- dmu_tx_commit(tx);