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>


   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
  25  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  26  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  27  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.

  28  */
  29 
  30 #ifndef _LIBZFS_H
  31 #define _LIBZFS_H
  32 
  33 #include <assert.h>
  34 #include <libnvpair.h>
  35 #include <sys/mnttab.h>
  36 #include <sys/param.h>
  37 #include <sys/types.h>
  38 #include <sys/varargs.h>
  39 #include <sys/fs/zfs.h>
  40 #include <sys/avl.h>
  41 #include <ucred.h>
  42 #include <libzfs_core.h>
  43 
  44 #ifdef  __cplusplus
  45 extern "C" {
  46 #endif
  47 


 580         /* do deduplication */
 581         boolean_t dedup;
 582 
 583         /* send properties (ie, -p) */
 584         boolean_t props;
 585 
 586         /* do not send (no-op, ie. -n) */
 587         boolean_t dryrun;
 588 
 589         /* parsable verbose output (ie. -P) */
 590         boolean_t parsable;
 591 
 592         /* show progress (ie. -v) */
 593         boolean_t progress;
 594 
 595         /* large blocks (>128K) are permitted */
 596         boolean_t largeblock;
 597 
 598         /* WRITE_EMBEDDED records of type DATA are permitted */
 599         boolean_t embed_data;



 600 } sendflags_t;
 601 
 602 typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *);
 603 
 604 extern int zfs_send(zfs_handle_t *, const char *, const char *,
 605     sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **);
 606 extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags);
 607 extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd,
 608     const char *);
 609 extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl,
 610     const char *token);
 611 
 612 extern int zfs_promote(zfs_handle_t *);
 613 extern int zfs_hold(zfs_handle_t *, const char *, const char *,
 614     boolean_t, int);
 615 extern int zfs_hold_nvl(zfs_handle_t *, int, nvlist_t *);
 616 extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t);
 617 extern int zfs_get_holds(zfs_handle_t *, nvlist_t **);
 618 extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *);
 619 




   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
  25  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  26  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  27  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  28  * Copyright 2015 RackTop Systems.
  29  */
  30 
  31 #ifndef _LIBZFS_H
  32 #define _LIBZFS_H
  33 
  34 #include <assert.h>
  35 #include <libnvpair.h>
  36 #include <sys/mnttab.h>
  37 #include <sys/param.h>
  38 #include <sys/types.h>
  39 #include <sys/varargs.h>
  40 #include <sys/fs/zfs.h>
  41 #include <sys/avl.h>
  42 #include <ucred.h>
  43 #include <libzfs_core.h>
  44 
  45 #ifdef  __cplusplus
  46 extern "C" {
  47 #endif
  48 


 581         /* do deduplication */
 582         boolean_t dedup;
 583 
 584         /* send properties (ie, -p) */
 585         boolean_t props;
 586 
 587         /* do not send (no-op, ie. -n) */
 588         boolean_t dryrun;
 589 
 590         /* parsable verbose output (ie. -P) */
 591         boolean_t parsable;
 592 
 593         /* show progress (ie. -v) */
 594         boolean_t progress;
 595 
 596         /* large blocks (>128K) are permitted */
 597         boolean_t largeblock;
 598 
 599         /* WRITE_EMBEDDED records of type DATA are permitted */
 600         boolean_t embed_data;
 601 
 602         /* skip free records, not receivable as a clone */
 603         boolean_t skip_free;
 604 } sendflags_t;
 605 
 606 typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *);
 607 
 608 extern int zfs_send(zfs_handle_t *, const char *, const char *,
 609     sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **);
 610 extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags);
 611 extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd,
 612     const char *);
 613 extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl,
 614     const char *token);
 615 
 616 extern int zfs_promote(zfs_handle_t *);
 617 extern int zfs_hold(zfs_handle_t *, const char *, const char *,
 618     boolean_t, int);
 619 extern int zfs_hold_nvl(zfs_handle_t *, int, nvlist_t *);
 620 extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t);
 621 extern int zfs_get_holds(zfs_handle_t *, nvlist_t **);
 622 extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *);
 623