Author: mav
Date: Mon Mar 21 00:16:42 2016
New Revision: 297111
URL: https://svnweb.freebsd.org/changeset/base/297111

Log:
  MFC r296516: MFV r296515:
  6536 zfs send: want a way to disable setting of DRR_FLAG_FREERECORDS
  
  Reviewed by: Anil Vijarnia <avijar...@racktopsystems.com>
  Reviewed by: Kim Shrier <kshr...@racktopsystems.com>
  Reviewed by: Matthew Ahrens <mahr...@delphix.com>
  Approved by: Dan McDonald <dan...@omniti.com>
  Author: Andrew Stormont <astorm...@racktopsystems.com>
  
  illumos/illumos-gate@880094b6062aebeec8eda6a8651757611c83b13e

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Mar 
21 00:15:41 2016        (r297110)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Mar 
21 00:16:42 2016        (r297111)
@@ -25,6 +25,7 @@
  * Copyright (c) 2014, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012, Martin Matuska <m...@freebsd.org>. All rights reserved.
  * Copyright 2014 HybridCluster. All rights reserved.
+ * Copyright 2016 RackTop Systems.
  */
 
 #include <sys/dmu.h>
@@ -64,6 +65,12 @@
 int zfs_send_corrupt_data = B_FALSE;
 int zfs_send_queue_length = 16 * 1024 * 1024;
 int zfs_recv_queue_length = 16 * 1024 * 1024;
+/* Set this tunable to FALSE to disable setting of DRR_FLAG_FREERECORDS */
+int zfs_send_set_freerecords_bit = B_TRUE;
+
+#ifdef _KERNEL
+TUNABLE_INT("vfs.zfs.send_set_freerecords_bit", &zfs_send_set_freerecords_bit);
+#endif
 
 static char *dmu_recv_tag = "dmu_recv_tag";
 const char *recv_clone_name = "%recv";
@@ -771,7 +778,8 @@ dmu_send_impl(void *tag, dsl_pool_t *dp,
        drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid;
        if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET)
                drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA;
-       drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
+       if (zfs_send_set_freerecords_bit)
+               drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
 
        if (ancestor_zb != NULL) {
                drr->drr_u.drr_begin.drr_fromguid =

Modified: 
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h    
Mon Mar 21 00:15:41 2016        (r297110)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h    
Mon Mar 21 00:16:42 2016        (r297111)
@@ -21,6 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+ * Copyright 2016 RackTop Systems.
  */
 
 #ifndef        _SYS_ZFS_IOCTL_H
@@ -124,6 +125,10 @@ typedef enum dmu_send_resume_token_versi
 
 #define        DMU_BACKUP_MAGIC 0x2F5bacbacULL
 
+/*
+ * Send stream flags.  Bits 24-31 are reserved for vendor-specific
+ * implementations and should not be used.
+ */
 #define        DRR_FLAG_CLONE          (1<<0)
 #define        DRR_FLAG_CI_DATA        (1<<1)
 /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to