Print this page
6536 zfs send: want a way to disable sending of free records
Reviewed by: Alexander Stetsenko <astetsenko@racktopsystems.com>
Reviewed by: Kim Shrier <kshrier@racktopsystems.com>

@@ -23,10 +23,11 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+ * Copyright 2015 RackTop Systems.
  */
 
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>

@@ -812,10 +813,11 @@
         char prevsnap[ZFS_MAXNAMELEN];
         uint64_t prevsnap_obj;
         boolean_t seenfrom, seento, replicate, doall, fromorigin;
         boolean_t verbose, dryrun, parsable, progress, embed_data, std_out;
         boolean_t large_block;
+        boolean_t skip_free;
         int outfd;
         boolean_t err;
         nvlist_t *fss;
         nvlist_t *snapholds;
         avl_tree_t *fsavl;

@@ -1182,10 +1184,12 @@
                 enum lzc_send_flags flags = 0;
                 if (sdd->large_block)
                         flags |= LZC_SEND_FLAG_LARGE_BLOCK;
                 if (sdd->embed_data)
                         flags |= LZC_SEND_FLAG_EMBED_DATA;
+                if (sdd->skip_free)
+                        flags |= LZC_SEND_FLAG_SKIP_FREE;
 
                 err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj,
                     fromorigin, sdd->outfd, flags, sdd->debugnv);
 
                 if (sdd->progress) {

@@ -1748,10 +1752,11 @@
         sdd.verbose = flags->verbose;
         sdd.parsable = flags->parsable;
         sdd.progress = flags->progress;
         sdd.dryrun = flags->dryrun;
         sdd.large_block = flags->largeblock;
+        sdd.skip_free = flags->skip_free;
         sdd.embed_data = flags->embed_data;
         sdd.filter_cb = filter_func;
         sdd.filter_cb_arg = cb_arg;
         if (debugnvp)
                 sdd.debugnv = *debugnvp;